Why pedantic?

Paul_Koning@Dell.com Paul_Koning@Dell.com
Tue Aug 25 12:52:00 GMT 2015

> On Aug 25, 2015, at 6:05 AM, Pedro Alves <palves@redhat.com> wrote:
> On 08/24/2015 07:13 PM, Paul_Koning@Dell.com wrote:
>> I'm trying to understand why --pedantic is specified in several of the subdirectories used with building gdb -- and in particular, why there isn't any obvious way to turn that off.  I've run into this in "libiberty" and possibly also "libdecnumber".  While this may be ok for Linux, it breaks some cross-builds.  At the very least I end up having to work around a pile of "C90 doesn't support blah blah" messages that now need to go into the "ignore this warning during builds" list in my build procedures.
>> "pedantic" generally defines warnings that are suggested by the standard but are judged to be not particularly useful -- so why use them unconditionally?
> I don't know the history behind this, but libiberty's and opcodes's configure.ac
> call ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, defined in src/config/warnings.m4,
> and that seems to be to be what adds the -pedantic.

Yes, I found that and removed it from our local copy.  But it seems to me that this change is misguided and should be undone, preferably as the default, or at the very least it needs to be an option.

The problem is that the libiberty build, as is typical, uses header files from the host, and there is no reason to assume that all those headers on every supported host OS are pedantic-safe.


More information about the Gdb mailing list