[Xorp-hackers] TODO list for rls 1.7

Ben Greear greearb at candelatech.com
Fri Apr 23 10:49:39 PDT 2010


On 04/23/2010 10:43 AM, Mark Handley wrote:
> On 23 April 2010 18:23, Ben Greear<greearb at candelatech.com>  wrote:
>> On 04/23/2010 10:10 AM, Mark Handley wrote:
>>>
>>> Thanks for the fix Ben.
>>>
>>> On -Werror, on many occasions it's annoyed me, but on a fair number of
>>> occasions it's saved my bacon.  I'd rather keep it and do the right
>>> thing.  Just my personal view though.
>>
>> I'm all for fixing the warnings, but the netlink related alignment errors on
>> Linux
>> cannot be fixed in a useful manner as far as I can tell because the errors
>> are in the
>> standard linux include headers.
>
> Fair enough.  I just want to minimize the code that is compiled
> without -Werror, not reduce it to absolutely zero.

I couldn't find a way to disable it for individual files.  Seems like
#pragmas should work from gcc docs I read..but they didn't work in
practice, especially not on slightly older compilers.

Here's my proposed patch.  It leaves warnings on for x86 and x86-64,
so I think that's pretty good coverage.  If someone can confirm that
other architectures work, we can add those to the white-list.


diff --git a/trunk/xorp/SConstruct b/trunk/xorp/SConstruct
index 49c1b81..0d469bc 100644
--- a/trunk/xorp/SConstruct
+++ b/trunk/xorp/SConstruct
@@ -535,9 +535,22 @@ env.AppendUnique(CPPDEFINES = [
      ( 'BOOST_DISABLE_THREADS' ),
      ])

+# Some platforms have alignment warnings that cannot easily be
+# fixed, so we can't enable Werror for them.
+if (host_cpu == "i686" or
+    host_cpu == "x86_64"):
+        env.AppendUnique(CFLAGS = [
+               '-Werror',
+               ])
+       env.AppendUnique(CXXFLAGS = [
+               '-Werror',
+               ])
+else:
+       print "WARNING:  Detected non x86 platform, will not enable -Werror compile option: ", host_cpu
+
+
  # NOTE: gcc specific flags.
  env.AppendUnique(CFLAGS = [
-    '-Werror',
      '-W',
      '-Wall',
      '-Wwrite-strings',
@@ -553,7 +566,6 @@ env.AppendUnique(CFLAGS = [
      ])

  env.AppendUnique(CXXFLAGS = [
-    '-Werror',
      '-W',
      '-Wall',
      '-Wwrite-strings',


Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list