Commit Graph

29 Commits

Author SHA1 Message Date
des
5d547700c7 Revert to a known-good state. Anyone desiring to experiment with stricter
global settings is free to do so in his or her own source tree.
2003-06-14 11:57:44 +00:00
peter
bc201df6b8 We cannot use c99 on amd64 either due to lack of alloca(). libc:strptime()
uses alloca() and alloca is impossible to implement as a callable function
on amd64.  It has to be a compiler builtin.  Note that the bigger problem
is that libc is not c99 clean internally.
2003-06-13 21:54:21 +00:00
obrien
9b92f918c2 Be C std strict on i386 and amd64 as we can. Be loose on Alpha and ia64. 2003-06-07 08:05:35 +00:00
obrien
93e4e9df9b Compile our code as C99 w/GNU extensions by default.
We can't use straight "c99" due to the lack of alloca.S for non-i386 platforms.
2003-06-06 16:55:05 +00:00
obrien
5c52044b3d I got a bazzar bug report 2003-06-02 08:10:57 +00:00
obrien
4f1dd109b8 Turn back on c99, the tree should be ready for it now. 2003-06-02 06:26:14 +00:00
obrien
c2c5b39ab7 To quote Tony Maher <tonymaher@optushome.com.au>, "maybe 3rd time lucky ;-)"
*sigh* Just can't get a brake when trying to react too quickly and fix the build.
2003-06-02 01:01:42 +00:00
obrien
e15b452288 Temperarly turn off building the tree with c99.
I swore this made it thru a 'make world', but I don't know what happened.
2003-06-02 00:11:07 +00:00
obrien
45f07c7359 Use a bigger hammer -- keep all -std= out of CXXFLAGS.
Also allow for "CSTD=" in a Makefile.
2003-06-01 22:13:45 +00:00
obrien
00cddc9c66 Do not set a C standard for the C++ compiler. 2003-06-01 21:33:05 +00:00
obrien
07f2e845ae Compile our code as C99 by default. 2003-06-01 18:31:25 +00:00
obrien
8c39502975 CSTD is virtually worthless for WARNS=2-5. Return -pedantic to WARNS=6+. 2003-05-31 16:37:22 +00:00
obrien
8b0354b4be Make CSTD style match the rest of file. 2003-05-31 16:30:39 +00:00
des
495eda8ee4 Whitespace cleanup (1.15 had spaces instead of tabs) 2003-05-05 21:14:36 +00:00
des
2a6383574f Don't use -pedantic unless we also set -std of some kind. 2003-05-05 21:13:32 +00:00
des
d147648191 Add a mechanism to allow Makefiles to specify the particular C dialect
in which the source code is written.  This is controlled by the CSTD
variable, which can have one of the following values:

  - "k&r"		=> -traditional
  - "c89" or "c90"	=> -std=iso9899:1990
  - "c94" or "c95"	=> -std=iso9899:199409
  - "c99"		=> -std=iso9899:1999

The corresponding option is added to CFLAGS regardless of WARNS level.
This also removes -ansi from WARNS level 6, but adds -Wno-long-long to
work around a weird gcc bug (-ansi, which is supposedly equivalent to
-std=iso9899:1990, seems to turn long long warnings off instead of on)

If CSTD is undefined, CFLAGS are unchanged except for the -ansi /
-Wno-long-long change mentioned above for WARNS level 6.
2003-05-01 14:36:27 +00:00
imp
b0693a4cbc Migrate to a new way of dealing with building from old revisions of
FreeBSD.  This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build).  We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files.  We then include this directory when building host binaries.

This removes all the past release compatibilty hacks from various
places in the tree.  We still build on tip of stable and current.  I
will work with those that want to support more, although I anticipate
it will just work.

Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.
2003-04-05 20:30:30 +00:00
ru
db5ec15123 -Wall implies -Wuninitialized if -O is also in effect.
-Wuninitialized does not work without -O.

This fixes the ${WARNS} > 4 compilations with -O0.

Spotted by:	marcel
2003-04-04 10:47:06 +00:00
ru
874869c32c Enable cpp(1) warnings in system headers. GCC is oriented on
glibc which is externally maintained, so GCC ships with these
warnings turned off by default.  This is also consistent with
the src/contrib/gcc/c-lex.c,v 1.2 change.
2003-03-31 13:10:51 +00:00
ru
7920e22cea Take __FreeBSD_version into account when BOOTSTRAPPING. 2002-11-13 13:49:29 +00:00
obrien
6793e7aaf6 Be more strict with WARNS now -- the GCC 3.1 turmoil is behind us. 2002-07-07 18:47:52 +00:00
obrien
48306d2934 Tweak the WARNS levels a tad. 2002-05-19 18:24:00 +00:00
obrien
4267f26cd1 Gcc 3.1 has different -Wx flags. 2002-05-10 01:58:16 +00:00
obrien
824b21ae00 Add WARNS levels 5 and 6:
5 gives us -Wuninitialized rather than -Wno-uninitialized
6 gives us full BDECFLAGS
2002-04-10 02:45:22 +00:00
ru
b42f3eadf7 FreeBSD prior to 4.5-RELEASE and older versions of 5.0-CURRENT do not
have the __FBSDID() macro in <sys/cdefs.h>.  Fix this once and for all
for tools that need to be bootstrapped.

PR:		bin/36747
MFC after:	3 days
Prodded by:	obrien
2002-04-07 17:03:06 +00:00
dwmalone
ff2a69a53b Put -Wno-uninitialized at the end of the warns flags as it may be enabeled
by several flags (in this case -W and -Wall).

Reviewed by:	bde
2002-01-05 20:17:50 +00:00
obrien
43ede8b147 Add some granularity to the WARNS levels.
1:  add -Werror
2:  -Wall [only], as this is the most used warnings setting by developers
3:  our old `1'
4:  our old `2'
2001-12-15 06:02:15 +00:00
kris
4029cc2464 Only add -Werror if in fact we have set WARNS or WFORMAT to >0 2001-05-19 23:32:19 +00:00
kris
3252dc5107 Bring in the WARNS directive from NetBSD, localized in a new bsd.sys.mk
to avoid polluting sys.mk.  This directive controls the addition of
compiler warning flags to CFLAGS in a relatively compiler-neutral manner.

The idea is that WARNS can be set in Makefile.inc or in individual
Makefiles as they become clean, to prevent the introduction of new
warnings in the code.  -Werror is added by default
2001-05-19 23:18:21 +00:00