Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMQ-LibCZMQ1 RHEL-5 / gcc-4.1.2 fix #35

Open
maage opened this issue May 12, 2013 · 0 comments
Open

ZMQ-LibCZMQ1 RHEL-5 / gcc-4.1.2 fix #35

maage opened this issue May 12, 2013 · 0 comments

Comments

@maage
Copy link

maage commented May 12, 2013

There is problem when probing functions at toos/zmqcheck. At RHEL-5 all functions are found available and then it does not work.

At RHEL-5 there is gcc 4.1.2 and it does not return error when function is not declared when using -Wall -std=c99 -pedantic-errors.

$ cat foo.c
int main(void) {
   this_is_not_defined();
   return (0);
}
$ gcc -Wall  -std=c99 -pedantic-errors foo.c -c;echo $?
foo.c: In function ‘main’:
foo.c:2: warning: implicit declaration of function ‘this_is_not_defined’
0

If I add -Werror-implicit-function-declaration

$ gcc -Wall  -std=c99 -pedantic-errors -Werror-implicit-function-declaration foo.c -c;echo $?
foo.c: In function ‘main’:
foo.c:2: error: implicit declaration of function ‘this_is_not_defined’
1
$ 

So I've used this patch to build it:

--- ZMQ-LibCZMQ1-0.03-/tools/zmqcheck/Makefile.PL       2013-01-09 08:21:55.000000000 +0200
+++ ZMQ-LibCZMQ1-0.03/tools/zmqcheck/Makefile.PL        2013-05-12 16:37:45.000000000 +0300
@@ -39,7 +39,7 @@
     $postamble .= sprintf <<'EOM', ($func) x 3;
 %s:

-       @$(CC) -c $(PASTHRU_INC) $(INC) $(CCFLAGS) $(OPTIMIZE) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $(EXTRALIBS) -std=c99 -pedantic-errors %s.c -o %s.o >> zmqcheck.out 2>&1
+       @$(CC) -c $(PASTHRU_INC) $(INC) $(CCFLAGS) $(OPTIMIZE) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $(EXTRALIBS) -std=c99 -Werror-implicit-function-declaration -pedantic-errors %s.c -o %s.o >> zmqcheck.out 2>&1

 EOM
 }

But I think some other strategy might be in order to to probing properly.

Later gcc versions (RHEL-6 / gcc-4.4.6) work as expected without any patching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant