Skip to content

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

Description

@maage

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions