[rtems commit] leon3/.../ckinit.c: Fix missing prototype warnings

Joel Sherrill Joel.Sherrill at OARcorp.com
Mon Sep 23 11:28:17 UTC 2013


I'm traveling this morning but will review the changes. I know some can't be static but this one (and all other clock get nanosecond handlers) can be static.

I was just tired of all the warnings. If I have to commit a fix to get suggestions on a better fix, then it is working. :)

--joel

Peter Dufault <dufault at hda.com> wrote:


I agree with Chris and Gedare.  IMO:
- Statics have no declarations but are ordered such that they are defined first in the source.  This can be argued, some like to defer the definition arguing it puts unimportant details early in a file and so use static declarations.
- System-wide externals are declared in system-wide header files;
- Directory-local externals are declared in directory-local header files (not sure RTEMS layout likes that) or the directory is re-organized to be made statics (if possible without ballooning file size).

So:
- externals are declared once, and only once, in a header.
- objects are defined once, and only once, in a source.

On Sep 23, 2013, at 09:56 , Chris Johns <chrisj at rtems.org> wrote:

> Joel Sherrill wrote:
>> This warning is largely useless if you don't want that. That's mostly what it complains about.
>>
>> But it does sometimes find something really wrong
>>
>
> Is 'bsp_clock_nanoseconds_since_last_tick' referenced outside of the
> file ? If yes then there needs to a header file and if no then why not
> make it static ?
>
> Chris

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering





More information about the devel mailing list