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

Peter Dufault dufault at hda.com
Mon Sep 23 11:23:07 UTC 2013


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