Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2003 08:02:11 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Craig Rodrigues <rodrigc@attbi.com>
Cc:        freebsd-hackers@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: #warning must be protected by #if __GNUC__ in headers?
Message-ID:  <3E6CB703.98FD0A2E@mindspring.com>
References:  <20030308161943.GA54921@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Rodrigues wrote:
> In <sys/syslimits.h>, I see:
> 
> #if __GNUC__
> #warning "No user-serviceable parts inside."
> #endif
> 
> Does the use of #warning need to be protected by
> #if __GNUC__ in FreeBSD header files?

Yes.  It is a preprocessor directive specific the GCC preprocessor.
This was discussed in great detail about a month ago, when the
people trying to get TenDRA to compile FreeBSD discovered to their
horror that TenDRA's preprocessor incorrectly assigns meaning to
code that's #if'ed out, and blew chunks on the #warning, when it
should have ignored it.

> Some other header files check for __GNUC__ before using #warning,
> such as <sys/ioctl.h>, but <sys/dkstat.h> does not.

<sys/dkstat.h> is wrong.  Please see the original discussion for
more details.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E6CB703.98FD0A2E>