This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

help on inconsistent printf() warning from gcc


Hi

In tracking down warnings in RTEMS, we have one which
is for a printf() format specifier on wchar_t. The code
originated in FreeBSD and the initial code we had did
have the wrong specifier. But this was flagged on a subset
of targets. When I corrected the warning, the situation
changed and some targets gave false positive.

I have attached correct and incorrect test cases. I am hoping
someone here can give me a clue as to where to look. I am
wondering if this is an inconsistency across targets in the
C library. I did file this as GCC PR63301 but it was quickly
closed as invalid. But I think the inconsistent generation of
warnings is a bug.

The test script "j" and its output are attached. Notice some
targets have no warnings, some warning on both, and mixes.
I would expect the output to be similar on *-elf targets.

Any suggestions on how to address this? I would love to
see our code be warning free on all targets.

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

Attachment: correct_wchar.c
Description: Text document

Attachment: incorrect_wchar.c
Description: Text document

Attachment: j
Description: Text document

Attachment: output.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]