Re: POSIX_C_SOURCE

From: Erik Trulsson (ertr1013_at_student.uu.se)
Date: 08/30/03

  • Next message: Ilya: "kernel panic running snort on stable"
    Date: Sat, 30 Aug 2003 20:22:00 +0200
    To: Matthew Dillon <dillon@apollo.backplane.com>
    
    

    On Sat, Aug 30, 2003 at 10:30:01AM -0700, Matthew Dillon wrote:
    > This is precisely what I did a few days ago in DragonFly. The warnings
    > were getting annoying.

    Only a few days ago? You must be harder to annoy than I am. :-)
    I have been using that patch since January, which is when the warnings
    got too annoying for me.

    (In case somebody wonders: No, I have not had any problems whatsoever
    with that patch during the seven months I have used it, nor do I expect
    any problems with it in the future. The only effect the patch has is
    to get rid of lots of annoying and (in this case) useless warnings.

    Personally I can't think of any good reason to *not* apply that patch
    to RELENG_4 as soon as possible, but since I don't have a commit bit
    that decision is not mine to make.)

    >
    > -Matt
    > Matthew Dillon
    > <dillon@backplane.com>
    >
    > :
    > :On Sat, Aug 30, 2003 at 12:49:15PM -0400, Garrett Wollman wrote:
    > :> In article <20030830161813.GA28890@twisted.net> you write:
    > :>
    > :> >Any chance that someone will finally commit the fixes to prevent the
    > :> >POSIX_C_SOURCE warnings from showing up? I saw a number of posts on this
    > :> >topic, but it still seems like it's not "officially committed"
    > :>
    > :> >/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
    > :> >/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
    > :>
    > :> The warnings are wrong,[1] so you should probably ask the GCC people
    > :> about that.
    > :
    > :The warnings are not wrong (see below), but anyway, since -stable uses
    > :the "ancient" GCC 2.95.4, the GCC people are not likely to
    > :give a damn in either case. They usually don't care about the older
    > :releases.
    > :
    > :>
    > :> -GAWollman
    > :>
    > :> [1] That is to say, any identifier used in a preprocessor expression
    > :> (after macro expansion) is defined to have a value of zero, and GCC
    > :> should not be complaining about this.
    > :
    > :The code is correct, which is why GCC only gives a warning and not an
    > :error. Code looking like that are usually an indication of a
    > :programmer error though, so GCC is perfectly right in warning about
    > :it. This is similar to the compiler warning about unused variables,
    > :which isn't a bug either but often indicates a programmer mistake.
    > :
    > :To make gcc shut up, you can apply the following patch to cdefs.h
    > :which makes the warnings go away, without changing the semantics of the
    > :include file in any way.
    > :
    > :
    > :Index: cdefs.h
    > :===================================================================
    > :RCS file: /ncvs/src/sys/sys/cdefs.h,v
    > :retrieving revision 1.28.2.8
    > :diff -u -r1.28.2.8 cdefs.h
    > :--- cdefs.h 18 Sep 2002 04:05:13 -0000 1.28.2.8
    > :+++ cdefs.h 29 Jan 2003 21:23:30 -0000
    > :@@ -269,6 +269,8 @@
    > : * Our macros begin with two underscores to avoid namespace screwage.
    > : */
    > :
    > :+#ifdef _POSIX_C_SOURCE
    > :+
    > : /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
    > : #if _POSIX_C_SOURCE == 1
    > : #undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
    > :@@ -280,6 +282,8 @@
    > : #undef _POSIX_C_SOURCE
    > : #define _POSIX_C_SOURCE 199209
    > : #endif
    > :+
    > :+#endif /* _POSIX_C_SOURCE */
    > :
    > : /* Deal with various X/Open Portability Guides and Single UNIX Spec. */
    > : #ifdef _XOPEN_SOURCE
    > :
    > :

    -- 
    <Insert your favourite quote here.>
    Erik Trulsson
    ertr1013@student.uu.se
    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
    

  • Next message: Ilya: "kernel panic running snort on stable"

    Relevant Pages

    • Re: any value to "NORET_TYPE" macro?
      ... >>> sprinkled throughout the tree? ... AFAICT, NORET_TYPE must've been introduced to silence gcc _warnings_, ... So the way to "test" your patch would be to see if there is any increase / ... decrease in the number of *warnings* blurted out by gcc during kernel build ...
      (Linux-Kernel)
    • [PATCH] disable gcc warnings of sign/unsigned comparison
      ... Please consider applying the following patch. ... This patch turns off all gcc warnings on comparing signed with unsigned ...
      (Linux-Kernel)
    • [PATCH 1/2] new valid_signal function (fwd)
      ... A while back I attempted to fix a little, not at all critical, gcc -W ... Below is the first patch that adds the new function. ... pointless and generates warnings when building with gcc -W. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [resend][PATCH] avoid signed vs unsigned comparison in efi_range_is_wc()
      ... >> I send in the patch below a while back but never recieved any response. ... > There are surely many warnings in the tree, ... with gcc -W of the same config gives me 100177 warnings. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [RFC] spinlock_t & rwlock_t break_lock member initialization (patch seeking comments include
      ... with the patch below applied for a few days and I see no ill effects. ... > down on the number of warnings I have to sift through. ... > initialization code neglects to initialize this extra member in that case. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)