Remove warnings from RTEMS crt0.c

Joel Sherrill
Thu Aug 4 06:56:00 GMT 2011

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.

>> 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.  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

         newlib_cflags="${newlib_cflags} -Wall"

> Apart of this, should there be warnings, these likely are harmless and
> just "stylishness", because this crt0.c's only purpose is to provide
> symbols and doesn't have any actual functionality,
The code is just stubs that generate warnings.  Call it what
you want.  It has warnings and they need to be eliminated.

You either tolerate warnings or you don't.   I know you aren't
tolerant of warnings and can't believe you would tolerate any
warnings that can easily be removed.
>> I need
>> to build with multilib disabled to get an accurate count
>> and submit patches for the obvious ones.#
> This is another remark, I do not understand - It could indicate a bug in
> GCC's configuration.
If you compile the same file 500 times, you get 500 warnings.
Multilib compiles the same source N times so you get a
multiplier of N for the set of unique warnings.
>>> However, I am currently on vacation and only sporadically touch a
>>> keyboard. I'll try to check ASAP, but I hardly will be able to check
>>> before last week of August.
> I'll likely launch an RTEMS toolchain spin, either today or later this
> week for other reasons and check the build.logs.
If you don't add -Wall to the flags in, you will
never see any.
> Ralf

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

More information about the Newlib mailing list