Remove warnings from RTEMS crt0.c
Ralf Corsepius
ralf.corsepius@rtems.org
Thu Aug 4 07:54:00 GMT 2011
On 08/03/2011 05:11 PM, Joel Sherrill wrote:
> On 08/03/2011 09:59 AM, Ralf Corsepius wrote:
>> On 08/03/2011 03:10 PM, Joel Sherrill wrote:
>>> On 08/03/2011 12:38 AM, Ralf Corsepius wrote:
>>>> On 08/02/2011 08:13 PM, Joel Sherrill wrote:
>>>>> Hi,
>>>>>
>>>>> The RTEMS crt0.c is just a stub so autoconf
>>>>> will find methods. It uses a macro to
>>>>> generate stub bodies for routines we want
>>>>> autoconf to find that are not in libc.
>>>>> The macro that generates the stubs does
>>>>> not generate a return statement with properly
>>>>> typed argument. So when you do a -Wall, you
>>>>> get lots of warnings. This just eliminates
>>>>> the warnings.
>>>>>
>>>>> OK to commit?
>>>> Not for now. I'd firstly want to reproduce the warnings you are
>>>> mentioning and check why I don't see them.
>>>>
>>> I sent a private email to you on 19 July with this and an
>>> explanation.
>> I saw it, but was busy otherwise and did not have any time to look into
>> them.
>>
>>> I was trying to compile RTEMS with clang.
>> As you know, I consider these tries to be broken and invalid, because
>> you are using an different toolchain for a different target.
>>
> I get the same warning from gcc and clang.
I repeat ... your clang tries are broken and invalid.
xgcc warnings are worth to be looked into and to be checked for it they
are serious.
>
>>> FWIW You will also see a number of other warnings.
>> FYI: I see ZERO warnings when bootstrapping GCC+newlib.
>>
>
> I repeat... newlib for most targets including *-rtems* is NOT
> NOT NOT built with warnings enabled. That is why most people
> compiling newlib are NOT seeing warnings.
You see all warning an xgcc emits by default - This probably had been
the case ever since newlib exists.
> When clang flagged
> this, I double-checked that gcc would warn for the same thing
> if presented with -Wall. You have to add this to the
> *-rtems* stanza in configure.host.
>
> newlib_cflags="${newlib_cflags} -Wall"
Blindly adding -Wall contradicts portability. It won't harm rtems,
because RTEMS hardly will ever be compilable by any other compiler but
GCC - nevertheless it's a hack.
Apart of this, IMO, the right place to specify -Wall would be gcc's
toplevel configure, such that _all_ target compiled libraries will
receive such flags, not only newlib (which is just one amongst many
target-libs).
Ralf
More information about the Newlib
mailing list