clang, unlike gcc, will warn on inline functions which are
unused. This can happen if a function is either intended to be used in
the future, or it is only used under certain config options. Mark
those functions with the "unused" attribute; not only does it quiet
the warning, but it also documents it for the user.
Shuffle around the warning options in configure and add a few more
that are specific to clang.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Set an expression descent limit to 8192, which is more reasonable to
expect to work on most platforms. Furthermore, if getrlimit() exists,
then try to use it to see if we need to further limit the size.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
config/config.h as generated by autoconf has #undef directives
commented out, but the autoheader-generated template contains them,
and config/unconfig.h should not contain them. Re-introduce
config/config.h.in, and postprocess it to generate config/unconfig.h
by commenting out all the #undef directives, just as configure does.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
<config/unconfig.h> is generated by autoconf (autoheader), but just
like the autoconf/helpers directory contains files for people who
don't have the proper tools, check this file in.
It should even be less annoying change-wise than the helpers...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Separate out function and function pointer attributes, as not all
versions of all compilers support both.
Have macros related to function attributes auto-generated by
autoheader. As a result, rename config.h.in to unconfig.h, to make it
more obvious that it is really intended to be included from some C
programs.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
[f]stat on Windows is messy: we need to use _stati64 for maximum
compatibility, but because there is a bunch of stuff wrapped in
macros, autoconf sometimes gets the wrong answers.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
On Windows we need to use _stati64/_fstati64 in order to handle large
file sizes, but the handling was broken in the canned MSVC++
configuration. Clean it up and fix it.
This addresses BR 3392398.
Reported-by: Nikolai Saoukh <nms@otdel-1.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
OpenWatcom still doesn't have proper support for 64-bit switch
statements. Hack around it in a truly vile way.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Move the canned OpenWatcom configuration file to config/watcom.h.
Also exclude config/config.h from being a dependency for MSVC.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Apparently, at least on some OS/2 compilers, <sys/types.h> needs to be
included for off_t to be defined. This seems like a generically good
idea to include this header whenever it is available.
Remove reference to <types.h>. This was supposedly for MSVC, but
there is no actual evidence that it is useful beyond <sys/types.h>.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Instead of trying to do hacks in the Makefiles, define header files
for specific compilers if they can't use autoconf. Currently defined
for Microsoft Visual Studio, based on MSDN documentation. It is
currently untested.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>