bug-gv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gv] [PATCH] avoid shadowing identifiers


From: Markus Steinborn
Subject: Re: [bug-gv] [PATCH] avoid shadowing identifiers
Date: Fri, 29 Apr 2011 19:47:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12

Hi Bernhard,

Bernhard R. Link schrieb:
Shadowing standard library functions is dangerous, as
they might be implemented as macros in some implementation.

[...]
--- a/gv/src/callbacks.c
+++ b/gv/src/callbacks.c
@@ -1032,9 +1032,8 @@ cb_presentation(w, client_data, call_data)
      XtPointer client_data, call_data;
  {
      int pid;
-    typedef void (*sighandler_t)(int);
      sighandler_t sigold;
This change do have a serious regression on Mac OS X (I've just got the bug report):

:info:build  callbacks.c: In function 'cb_presentation':
:info:build  callbacks.c:1034: error: 'sighandler_t' undeclared (first use in 
this function)
:info:build  callbacks.c:1034: error: (Each undeclared identifier is reported 
only once
:info:build  callbacks.c:1034: error: for each function it appears in.)
:info:build  callbacks.c:1034: error: expected ';' before 'sigold'
:info:build  callbacks.c:1038: error: 'sigold' undeclared (first use in this 
function)
:info:build  make[2]: *** [callbacks.o] Error 1
:info:build  make[1]: *** [all] Error 2
:info:build  make: *** [all-recursive] Error 1


Unless we find a better solution (GNULIB doesn't seem to provide sighandler_t, because "find -type f -exec grep sighandler_t {} +" does not find any match) I'll have to add the typedef again.

Greetings

Markus Steinborn
GNU gv maintainer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]