* Why pedantic?
@ 2015-08-24 18:15 Paul_Koning
2015-08-25 10:05 ` Pedro Alves
0 siblings, 1 reply; 7+ messages in thread
From: Paul_Koning @ 2015-08-24 18:15 UTC (permalink / raw)
To: gdb
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?
paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-24 18:15 Why pedantic? Paul_Koning
@ 2015-08-25 10:05 ` Pedro Alves
2015-08-25 12:52 ` Paul_Koning
0 siblings, 1 reply; 7+ messages in thread
From: Pedro Alves @ 2015-08-25 10:05 UTC (permalink / raw)
To: Paul_Koning, gdb
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.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-25 10:05 ` Pedro Alves
@ 2015-08-25 12:52 ` Paul_Koning
2015-08-25 13:05 ` Andreas Schwab
0 siblings, 1 reply; 7+ messages in thread
From: Paul_Koning @ 2015-08-25 12:52 UTC (permalink / raw)
To: palves; +Cc: gdb
> 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.
paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-25 12:52 ` Paul_Koning
@ 2015-08-25 13:05 ` Andreas Schwab
2015-08-25 13:17 ` Paul_Koning
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2015-08-25 13:05 UTC (permalink / raw)
To: Paul_Koning; +Cc: palves, gdb
<Paul_Koning@Dell.com> writes:
> 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.
GCC suppresses warnings in system headers by default.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-25 13:05 ` Andreas Schwab
@ 2015-08-25 13:17 ` Paul_Koning
2015-08-25 13:41 ` Pedro Alves
2015-08-25 13:44 ` Andreas Schwab
0 siblings, 2 replies; 7+ messages in thread
From: Paul_Koning @ 2015-08-25 13:17 UTC (permalink / raw)
To: schwab; +Cc: palves, gdb
> On Aug 25, 2015, at 9:05 AM, Andreas Schwab <schwab@suse.de> wrote:
>
> <Paul_Koning@Dell.com> writes:
>
>> 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.
>
> GCC suppresses warnings in system headers by default.
For cross-builds? Not in the ones we do. Is there some command line switch that needs to be passed to tell gcc that a particular include directory is for "system headers" and to apply that rule?
paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-25 13:17 ` Paul_Koning
@ 2015-08-25 13:41 ` Pedro Alves
2015-08-25 13:44 ` Andreas Schwab
1 sibling, 0 replies; 7+ messages in thread
From: Pedro Alves @ 2015-08-25 13:41 UTC (permalink / raw)
To: Paul_Koning, schwab; +Cc: gdb
On 08/25/2015 02:17 PM, Paul_Koning@dell.com wrote:
>
>> On Aug 25, 2015, at 9:05 AM, Andreas Schwab <schwab@suse.de> wrote:
>>
>> <Paul_Koning@Dell.com> writes:
>>
>>> 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.
>>
>> GCC suppresses warnings in system headers by default.
>
> For cross-builds? Not in the ones we do. Is there some command line switch that needs to be passed to tell gcc that a particular include directory is for "system headers" and to apply that rule?
-isystem instead of -I.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Why pedantic?
2015-08-25 13:17 ` Paul_Koning
2015-08-25 13:41 ` Pedro Alves
@ 2015-08-25 13:44 ` Andreas Schwab
1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2015-08-25 13:44 UTC (permalink / raw)
To: Paul_Koning; +Cc: palves, gdb
<Paul_Koning@Dell.com> writes:
>> On Aug 25, 2015, at 9:05 AM, Andreas Schwab <schwab@suse.de> wrote:
>>
>> <Paul_Koning@Dell.com> writes:
>>
>>> 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.
>>
>> GCC suppresses warnings in system headers by default.
>
> For cross-builds?
Yes. The cross environment should be identical to the native one, apart
from the different host.
> Not in the ones we do. Is there some command line switch that needs to be passed to tell gcc that a particular include directory is for "system headers" and to apply that rule?
-isystem
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-25 13:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24 18:15 Why pedantic? Paul_Koning
2015-08-25 10:05 ` Pedro Alves
2015-08-25 12:52 ` Paul_Koning
2015-08-25 13:05 ` Andreas Schwab
2015-08-25 13:17 ` Paul_Koning
2015-08-25 13:41 ` Pedro Alves
2015-08-25 13:44 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox