cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fwd: Bug#213180: libcurl2-dev: -Wshadow warning from curl.h with unistd.h

From: Domenico Andreoli <cavok_at_filibusta.crema.unimi.it>
Date: Tue, 30 Sep 2003 15:51:40 +0200

hi,

is it possible to rename that variable in something that does not
clashes with compilers' variable?

cheers
dom

----- Forwarded message from Neil Spring <nspring_at_cs.washington.edu> -----

Date: Sun, 28 Sep 2003 15:14:16 -0700
From: Neil Spring <nspring_at_cs.washington.edu>
To: Debian Bug Tracking System <submit_at_bugs.debian.org>
Reply-To: Neil Spring <nspring_at_cs.washington.edu>,
        213180_at_bugs.debian.org
Subject: Bug#213180: libcurl2-dev: -Wshadow warning from curl.h with unistd.h

Package: libcurl2-dev
Version: 7.10.7-2
Severity: wishlist

It would be nice if curl.h did not use "access" in the prototype of
curl_lock_function, as gcc 2.95.4 complains with -Wshadow.

  jimbo:~/tmp> cat curlt.c
  #include <unistd.h>
  #include <curl/curl.h>
  int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) {
    exit(0);
  }

  jimbo:~/tmp> gcc -Wshadow curlt.c
  In file included from curlt.c:2:
  /usr/include/curl/curl.h:1056: warning: declaration of `access' shadows global declaration

This makes it difficult to compile my code with -Werror,
which was not a problem with woody's version of curl-dev.

For a prototype,
  typedef void (*curl_lock_function)(CURL *handle,
                                     curl_lock_data data,
                                     curl_lock_access access,
                                     void *userptr);
is pretty uninformative, and the "handle" "data" "access"
and "userptr" names could all be dropped or replaced with
meaningful names.

I mark it as wishlist as gcc-3.0 and gcc-3.3 do not complain.

thanks,
-neil

----- End forwarded message -----

-----[ Domenico Andreoli, aka cavok
 --[ http://filibusta.crema.unimi.it/~cavok/gpgkey.asc
   ---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-30