change log for rtems (2011-12-13)

Ralf Corsepius ralf.corsepius at rtems.org
Wed Dec 14 08:32:48 UTC 2011


On 12/13/2011 02:10 PM, rtems-vc at rtems.org wrote:
>   *sh*:
> 2011-12-13	Sebastian Huber<sebastian.huber at embedded-brains.de>
>
> diff -u rtems/cpukit/posix/src/mqueueunlink.c:1.18 rtems/cpukit/posix/src/mqueueunlink.c:1.19
> --- rtems/cpukit/posix/src/mqueueunlink.c:1.18	Sun Jul 24 18:55:08 2011
> +++ rtems/cpukit/posix/src/mqueueunlink.c	Tue Dec 13 06:56:53 2011

> diff -u /dev/null rtems/cpukit/posix/src/psxnametoid.c:1.1
> --- /dev/null	Tue Dec 13 07:10:22 2011
> +++ rtems/cpukit/posix/src/psxnametoid.c	Tue Dec 13 06:56:53 2011
> +
> +#include<rtems/posix/posixapi.h>
> +
> +#include<string.h>
> +#include<limits.h>
> +#include<errno.h>
> +
> +/* pure ANSI mode does not have this prototype */
> +size_t strnlen(const char *, size_t);

No unconditional local redeclarations of system functions, please.
This is unsafe and error-prone.

The system is supposed to provide appropriate prototypes.

In other words: In current GCC, -ansi implies c89, i.e. you must not 
unconditionally rely upon strnlen being present and therefore must not 
use it. Conversely, if you use it, the system must provide the prototype.

Ralf



More information about the devel mailing list