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

Chris Johns chrisj at rtems.org
Mon Sep 23 01:56:31 UTC 2013


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

> Gedare Bloom<gedare at gwmail.gwu.edu>  wrote:
>
>
> I dislike this prototype in a .c file especially just to satisfy
> compiler warnings.
>
> On Sep 22, 2013 11:52 AM, "Joel Sherrill" <joel at rtems.org
> <mailto:joel at rtems.org>> wrote:
>
>     Module: rtems
>     Branch: master
>     Commit: d2c5bff7dc5a93d5369e83e5c412c3b424dee781
>     Changeset:
>     http://git.rtems.org/rtems/commit/?id=d2c5bff7dc5a93d5369e83e5c412c3b424dee781
>
>     Author: Joel Sherrill <joel.sherrill at oarcorp.com
>     <mailto:joel.sherrill at oarcorp.com>>
>     Date: Sun Sep 22 10:51:36 2013 -0500
>
>     leon3/.../ckinit.c: Fix missing prototype warnings
>
>     ---
>
>     c/src/lib/libbsp/sparc/leon3/clock/ckinit.c | 6 +++++-
>     1 files changed, 5 insertions(+), 1 deletions(-)
>
>     diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
>     b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
>     index 79f8864..8aa0af3 100644
>     --- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
>     +++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
>     @@ -37,7 +37,6 @@
>     #define LEON3_CLOCK_INDEX 0
>     #endif
>
>     -
>     volatile struct gptimer_regs *LEON3_Timer_Regs = 0;
>     static int clkirq;
>
>     @@ -94,6 +93,11 @@ static int clkirq;
>     LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].ctrl = 0; \
>     } while (0)
>
>     +/*
>     + * Prototype to avoid warnings and body of get nanoseconds since
>     last tick
>     + */
>     +uint32_t bsp_clock_nanoseconds_since_last_tick(void);
>     +
>     uint32_t bsp_clock_nanoseconds_since_last_tick(void)
>     {
>     uint32_t clicks;
>
>     _______________________________________________
>     rtems-vc mailing list
>     rtems-vc at rtems.org <mailto:rtems-vc at rtems.org>
>     http://www.rtems.org/mailman/listinfo/rtems-vc
>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list