[PATCH 6/8] i386/pc386: Eliminate multiple warnings

Joel Sherrill joel.sherrill at oarcorp.com
Thu Oct 9 19:58:07 UTC 2014


On 10/9/2014 2:52 PM, Gedare Bloom wrote:
> On Thu, Oct 9, 2014 at 2:39 PM, Joel Sherrill <joel.sherrill at oarcorp.com> wrote:
>> ---
>>  c/src/lib/libbsp/i386/pc386/console/conscfg.c  |  7 +-
>>  c/src/lib/libbsp/i386/pc386/console/keyboard.c | 99 +++++++++++++-------------
>>  c/src/lib/libbsp/i386/pc386/console/outch.c    |  6 +-
>>  c/src/lib/libbsp/i386/pc386/console/rtd316.c   |  3 +-
>>  c/src/lib/libbsp/i386/pc386/console/rtd316.h   | 24 ++++++-
>>  c/src/lib/libbsp/i386/pc386/ide/ide.c          |  2 +
>>  c/src/lib/libbsp/i386/pc386/include/bsp.h      |  6 ++
>>  c/src/lib/libbsp/i386/pc386/startup/bspstart.c |  3 -
>>  c/src/lib/libbsp/i386/pc386/timer/timer.c      | 39 +++++-----
>>  c/src/lib/libbsp/i386/shared/comm/i386-stub.c  | 12 ++--
>>  10 files changed, 122 insertions(+), 79 deletions(-)
>>
>> -int
>> +static int
>>  hexToInt (char **ptr, int *intValue)
>>  {
> Put the function name on the line with return type? More like this above.
This is internally consistent in this file.

FWIW this file originated as part of gdb or some given away
support package. We don't want to reformat it.
>>    int numChars = 0;
>> @@ -742,8 +742,12 @@ hexToInt (char **ptr, int *intValue)
>>
>>  /*
>>   * This function does all command procesing for interfacing to gdb.
>> + *
>> + * NOTE: This method is called from assembly code so must be marked
>> + *       as used.
>>   */
>> -void
>> +static void handle_exception (int exceptionVector) __attribute__((used));
>> +static void
> I'm not certain what the semantics are for declaring  a function
> static when it is used from another source file. Perhaps it should be
> declared somewhere? Also, there should be an RTEMS_ATTRIBUTE_USED or
> similar that should be used here.
I thought about doing this.  But this file doesn't include <rtems.h>
and is already tightly coupled with gdb so I didn't see the harm in
adding a gcc specific attribute.

In this case, it is referenced in inline assembly. <sigh>
>>  handle_exception (int exceptionVector)
>>  {
>>    int sigval;
>> --
>> 1.9.3
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel

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



More information about the devel mailing list