local.h in scanf.c

J. Johnston jjohnstn@redhat.com
Wed Nov 19 19:08:00 GMT 2003


Artem B. Bityuckiy wrote:
> Hello.
> 
> We do some development with Newlib and have changed local.h. This caused 
> error while compiling scanf.c. See at newlib/libc/stdio/scanf.c - 
> local.h is included twice. Is this just non-essential defect? Why 
> local.h doesn't contain something like #ifdef _LOCAL_H_/#endif ?

local.h is just a local header file that is not externalized.  It is also not 
meant to be included multiple times.  The C header files available to the 
end-user have to be protected from multiple inclusion as some header files 
include others and the end-user is not restricted from including them multiple 
times.  This is not the case for local.h.

I have removed the extraneous 2nd include.  Thanks for spotting this.

-- Jeff J.

> If this is a defect I offer to:
> 1. exclude double local.h inclusion from scan.f
> 2. add #ifdef _LOCAL_H_/#endif to newlib/libc/stdio/local.h
> 
> Artem B. Bityuckiy.
> 



More information about the Newlib mailing list