[rtems-libbsd commit] Add error() to the BSD program support.

Chris Johns chrisj at rtems.org
Fri Jun 19 05:23:55 UTC 2015


On 18/06/2015 5:54 pm, Sebastian Huber wrote:
> 
>>> >
>>> >What is the reason for this #undef?
>>> >
>> I got warnings for printf in tcpdump for some reason so add the undef to
>> all symbols present.
>>
>> Does it hurt having it present ?
>>
> 
> Yes, since in this case we don't get the redefine warning in general.

Maybe but this whole hosting of the user land programs in RTEMS is a hack.

> This redefine might be ok in your special case, but in general it is not
> right to say in one place A -> B and in another A -> C. You can use the
> #undef before you include the rtems-bsd-program.h file.

I was fixing the warning for code that already existed:

In file included from ../../rtemsbsd/rtems/rtems-bsd-program.c:55:0:
/opt/work/chris/rtems/libbsd/rtems-libbsd.master/rtemsbsd/include/machine/rtems-bsd-program.h:87:0:
warning: "printf" redefined
    #define printf(...) fprintf(stdout, __VA_ARGS__)
 ^
In file included from
/opt/work/chris/rtems/libbsd/rtems-libbsd.master/rtemsbsd/include/machine/rtems-bsd-kernel-space.h:59:0,
                 from ../../rtemsbsd/rtems/rtems-bsd-program.c:40:
/opt/work/chris/rtems/libbsd/rtems-libbsd.master/rtemsbsd/include/machine/rtems-bsd-printf-to-iprintf.h:43:0:
note: this is the location of the previous definition
 #define printf iprintf
 ^

Would you like to fix the warning and then remove the #undef's ?

Thanks
Chris



More information about the devel mailing list