[gnutls-dev] prototype shadowing warning

Neil Spring nspring at cs.washington.edu
Sun Feb 6 18:09:18 CET 2005


Hi,

Please avoid using "index", "time" and "exp" as parameter names in 
function prototypes in header files to avoid -Wshadow warnings.  
Warnings follow. (yeah, I know the compiler should be a little smarter, 
but then again, "index" and "time" aren't very descriptive names for 
parameters.)

Sorry I'm so picky.

thanks,
-neil

gcc -DHAVE_CONFIG_H -I. -I. -I..   -I/usr/X11R6/include  -I/sw/include 
-I/sw/include -I/sw/include -I/sw/include -I/sw/include  -I/sw/include  
-g -O2 -D_GNU_SOURCE -W -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-no-cpp-precomp -I/sw/include -I/sw/include -I/sw/include -I/sw/include 
-I/sw/include  -I/sw/include -c `test -f 'tlsComm.c' || echo 
'./'`tlsComm.c
In file included from tlsComm.c:24:
/sw/include/gnutls/gnutls.h:660: warning: declaration of `exp' shadows 
a global declaration
<built-in>:0: warning: shadowed declaration is here
In file included from tlsComm.c:25:
/sw/include/gnutls/x509.h:233: warning: declaration of `index' shadows 
a global declaration
/usr/include/string.h:107: warning: shadowed declaration is here
/sw/include/gnutls/x509.h:234: warning: declaration of `time' shadows a 
global declaration
/usr/include/time.h:128: warning: shadowed declaration is here

hairshirt:~/sourceforge/wmbiff/wmbiff% gcc --version
gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is 
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

hairshirt:~/sourceforge/wmbiff/wmbiff% uname -a
Darwin hairshirt.local 7.7.0 Darwin Kernel Version 7.7.0: Sun Nov  7 
16:06:51 PST 2004; root:xnu/xnu-517.9.5.obj~1/RELEASE_PPC  Power 
Macintosh powerpc

hairshirt:~/sourceforge/wmbiff/wmbiff% libgnutls-config --version
1.2.0

hairshirt:~/sourceforge/wmbiff/wmbiff% grep 1.2 
/sw/include/gnutls/gnutls.h
#define LIBGNUTLS_VERSION "1.2.0"
     GNUTLS_A_CERTIFICATE_UNOBTAINABLE=111, 
GNUTLS_A_UNRECOGNIZED_NAME=112,
extern const gnutls_datum_t gnutls_srp_1024_group_prime;
extern const gnutls_datum_t gnutls_srp_1024_group_generator;





More information about the Gnutls-devel mailing list