* Fix warnings
@ 2002-09-17 9:28 Andreas Jaeger
2002-09-17 13:28 ` Roland McGrath
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Jaeger @ 2002-09-17 9:28 UTC (permalink / raw)
To: GNU libc hacker
Building glibc produces lots of these warnings:
../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc'
../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc'
../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc'
And these:
ctype_l.c:28: warning: no previous prototype for `__isalnum_l'
ctype_l.c:29: warning: no previous prototype for `__isalpha_l'
ctype_l.c:30: warning: no previous prototype for `__iscntrl_l'
And also this one:
../sysdeps/posix/spawni.c:278: warning: control reaches end of non-void function
How can we add an __attribute__ ((noreturn)) to _exit in include/unistd.h?
Ok to commit the appended patch for the ctype warnings?
Andreas
2002-09-17 Andreas Jaeger <aj@suse.de>
* ctype/ctype_l.c (func): Add prototype.
* include/ctype.h: Add prototypes for __ctype_b_loc,
__ctype_toupper_loc, __ctype_tolower_loc to remove warnings.
============================================================
Index: ctype/ctype_l.c
--- ctype/ctype_l.c 6 Aug 2002 08:39:59 -0000 1.4
+++ ctype/ctype_l.c 17 Sep 2002 16:21:09 -0000
@@ -21,7 +21,8 @@
/* Provide real-function versions of all the ctype macros. */
-#define func(name, type) \
+#define func(name, type) \
+ extern int __##name (int c, __locale_t l); \
int __##name (int c, __locale_t l) { return __isctype_l (c, type, l); } \
weak_alias (__##name, name)
============================================================
Index: include/ctype.h
--- include/ctype.h 2 Sep 2002 07:08:54 -0000 1.5
+++ include/ctype.h 17 Sep 2002 16:21:09 -0000
@@ -22,6 +22,11 @@ __libc_tsd_define (extern, CTYPE_B)
__libc_tsd_define (extern, CTYPE_TOUPPER)
__libc_tsd_define (extern, CTYPE_TOLOWER)
+extern const uint16_t ** __attribute__ ((const)) __ctype_b_loc (void);
+extern const int32_t ** __attribute__ ((const)) __ctype_toupper_loc (void);
+extern const int32_t ** __attribute__ ((const)) __ctype_tolower_loc (void);
+
+
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
__ctype_b_loc (void)
{
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fix warnings
2002-09-17 9:28 Fix warnings Andreas Jaeger
@ 2002-09-17 13:28 ` Roland McGrath
2002-09-18 0:00 ` Andreas Jaeger
0 siblings, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2002-09-17 13:28 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: GNU libc hacker
> Building glibc produces lots of these warnings:
> ../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc'
> ../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc'
> ../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc'
Compiling what files? I don't see any such warnings. Are you using
unusual options? What compiler?
> And also this one:
> ../sysdeps/posix/spawni.c:278: warning: control reaches end of non-void function
>
> How can we add an __attribute__ ((noreturn)) to _exit in include/unistd.h?
It's a GCC bug. The attributes should be preserved by using typeof in
libc_hidden_proto, but are not. I see Ulrich has put it in a workaround,
but I think we should have just ignored it and get GCC fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fix warnings
2002-09-17 13:28 ` Roland McGrath
@ 2002-09-18 0:00 ` Andreas Jaeger
2002-09-18 0:09 ` Roland McGrath
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Jaeger @ 2002-09-18 0:00 UTC (permalink / raw)
To: Roland McGrath; +Cc: GNU libc hacker
Roland McGrath <roland@redhat.com> writes:
>> Building glibc produces lots of these warnings:
>> ../include/ctype.h:27: warning: no previous prototype for `__ctype_b_loc'
>> ../include/ctype.h:37: warning: no previous prototype for `__ctype_toupper_loc'
>> ../include/ctype.h:47: warning: no previous prototype for `__ctype_tolower_loc'
>
> Compiling what files? I don't see any such warnings. Are you using
> unusual options? What compiler?
GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find
such problems.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fix warnings
2002-09-18 0:00 ` Andreas Jaeger
@ 2002-09-18 0:09 ` Roland McGrath
2002-09-18 2:00 ` Andreas Jaeger
0 siblings, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2002-09-18 0:09 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: GNU libc hacker
> GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find
> such problems.
Ah, well extra warning options are sometimes not in the makefile for a
reason. I don't think the warnings for failing to have declared a
prototype prior to the prototype definition of a function are really
useful. The changes you make to suppress those warnings just give us yet
more error-prone duplication to wade through and have to fix up with
duplicate changes forevermore.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fix warnings
2002-09-18 0:09 ` Roland McGrath
@ 2002-09-18 2:00 ` Andreas Jaeger
2002-09-18 2:32 ` Roland McGrath
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Jaeger @ 2002-09-18 2:00 UTC (permalink / raw)
To: Roland McGrath; +Cc: GNU libc hacker
Roland McGrath <roland@redhat.com> writes:
>> GCC 3.2 and using -Wmissing-prototypes -Wmissing-declarations to find
>> such problems.
>
> Ah, well extra warning options are sometimes not in the makefile for a
> reason. I don't think the warnings for failing to have declared a
> prototype prior to the prototype definition of a function are really
> useful. The changes you make to suppress those warnings just give us yet
> more error-prone duplication to wade through and have to fix up with
> duplicate changes forevermore.
From Makeconfig:
# Extra flags to pass to GCC.
ifeq ($(all-warnings),yes)
+gccwarn := -Wall -Wwrite-strings -Winline -Wstrict-prototypes -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar
So, is the goal to get these warnings shut down eventually - or not?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fix warnings
2002-09-18 2:00 ` Andreas Jaeger
@ 2002-09-18 2:32 ` Roland McGrath
0 siblings, 0 replies; 6+ messages in thread
From: Roland McGrath @ 2002-09-18 2:32 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: GNU libc hacker
> So, is the goal to get these warnings shut down eventually - or not?
I don't think so. Some of the gcc warnings are just overeager.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-09-18 9:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-17 9:28 Fix warnings Andreas Jaeger
2002-09-17 13:28 ` Roland McGrath
2002-09-18 0:00 ` Andreas Jaeger
2002-09-18 0:09 ` Roland McGrath
2002-09-18 2:00 ` Andreas Jaeger
2002-09-18 2:32 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).