NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toupper and warnings



At Wed, 5 May 2021 20:33:30 -0000 (UTC), christos%astron.com@localhost (Christos Zoulas) wrote:
Subject: Re: toupper and warnings
>
> gcc hides warnings from system headers by default (my guess is because
> the Linux system headers have a concealed firearms license).
>
> Our bsd.sys.mk turns it on... Try gcc -Wall -Wsystem-headers

Does that really make the difference?

(I can't quickly test it at the moment as I've fixed my test system such
that I don't ever get these warnings from the ctype macros.  I.e. I went
the other way and chose to make my implementation's "undefined
behaviour" to be to behave as conservative as possible and allow the
caller to use these macros in the traditional naive way without fear and
without noisy warnings from picky compilers when char is signed.)

> I've been considering to make it the default for our native gcc,
> but then again I am against gratuitous user facing changes...

Note that -Wsystem-headers doesn't go well with -Wundef on NetBSD yet.

I find -Wundef to be quite helpful in writing more robust CPP
expressions -- it's saved me more than once from embarrassingly
non-portable ones, though I didn't start using it nearly soon enough.

--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpQ_heKo2heB.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index