]> mj.ucw.cz Git - libucw.git/commitdiff
Added switches for gcc-4.0. "-fstrict-aliasing" is now added only for
authorMartin Mares <mj@ucw.cz>
Sat, 28 May 2005 17:51:48 +0000 (17:51 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 28 May 2005 17:51:48 +0000 (17:51 +0000)
gcc 3.0 since 3.3 and newer turn in by default with -O2 or higher.
Added CWARNS_OFF, which turns off even the warnings which default to on.

Expect lots of warnings with gcc 4.0.0; some of them are caused by
compiler bugs (e.g., http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21800).

lib/autoconf.cfg

index 9a353a23d055461a9af616cceaaccc015bcf052b..815583f9dbfea9789355ae9df011f2eff49294aa 100644 (file)
@@ -102,7 +102,7 @@ if (Get("CPU_ARCH") eq "unknown") { Warn "CPU type not recognized, using default
 Set("CLANG" => "-std=gnu99");
 
 # C optimizations
-Set("COPT" => '-O2 -fstrict-aliasing');
+Set("COPT" => '-O2');
 Append("COPT", '-march=$(CPU_ARCH)') if IsSet("CPU_ARCH");
 
 # C optimizations for highly exposed code
@@ -110,6 +110,7 @@ Set("COPT2" => '-O3');
 
 # Warnings
 Set("CWARNS" => '-Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline');
+Set("CWARNS_OFF" => '');
 
 # Linker flags
 Set("LOPT" => "");
@@ -123,12 +124,17 @@ Set("LSHARED" => '-shared -Wl,-soname,lib/$(@F)');
 
 # Extra switches depending on GCC version:
 if ($gccver == 3000) {
+       Append("COPT" => "-fstrict-aliasing");
 } elsif ($gccver == 3003) {
        Append("CWARNS" => "-Wundef -Wredundant-decls");
        Append("COPT" => "-finline-limit=20000 --param max-inline-insns-auto=1000");
 } elsif ($gccver == 3004) {
        Append("CWARNS" => "-Wundef -Wredundant-decls");
        Append("COPT" => "-finline-limit=5000 --param large-function-insns=5000 --param inline-unit-growth=200 --param large-function-growth=400");
+} elsif ($gccver == 4000) {
+       Append("CWARNS" => "-Wundef -Wredundant-decls -Wno-pointer-sign -Wdisabled-optimization -Wno-missing-field-initializers");
+       Append("CWARNS_OFF" => "-Wno-pointer-sign");
+       Append("COPT" => "-finline-limit=5000 --param large-function-insns=5000 --param inline-unit-growth=200 --param large-function-growth=400");
 } else {
        Warn "Don't know anything about this GCC version, using default switches.\n";
 }