warning.h yet one more time

Jeff Johnston jjohnstn@redhat.com
Fri Jan 21 21:55:00 GMT 2005


Patch checked in.

-- Jeff J.

Hans-Peter Nilsson wrote:
> My previous tests were done by calling link_warning.  When
> suddenly stub_warning is used (that is, I link in libnosys.a), I
> see double:
> 
> /tmp/cris/lib/gcc/cris-unknown-elf/4.0.0/../../../../cris-unknown-elf/lib/libc.a(closer.o):
> In function `_close_r':
> /home/hp/cvs_areas/combined/combined/newlib/libc/reent/closer.c:53: warning: warning: _close is not implemented and will always fail
> ...
> 
> So, the GNU linker already adds a "warning: ".
> Unless the double warning is intended :-) I suggest this change:
> 
> 2005-01-21  Hans-Peter Nilsson  <hp@axis.com>
> 
> 	* libnosys/warning.h (stub_warning): Remove "warning: " prefix.
> 
> Index: warning.h
> ===================================================================
> RCS file: /cvs/src/src/libgloss/libnosys/warning.h,v
> retrieving revision 1.4
> diff -c -p -u -p -r1.4 warning.h
> cvs diff: conflicting specifications of output style
> --- warning.h	18 Jan 2005 19:27:44 -0000	1.4
> +++ warning.h	21 Jan 2005 18:06:40 -0000
> @@ -35,9 +35,10 @@
>  # define link_warning(symbol, msg)
>  #endif
>  
> -/* A canned warning for sysdeps/stub functions.  */
> +/* A canned warning for sysdeps/stub functions.
> +   The GNU linker prepends a "warning: " string.  */
>  #define stub_warning(name) \
>    link_warning (name, \
> -                "warning: " #name " is not implemented and will always fail")
> +                #name " is not implemented and will always fail")
>  
>  #endif /* __WARNING_H__ */
> 
> brgds, H-P



More information about the Newlib mailing list