Re: javascript appears to be broken again
On Thu, 2015-05-07 at 11:09 -0400, Andrew Stitcher wrote: On Wed, 2015-05-06 at 23:42 +0100, Gordon Sim wrote: ... Apparently these are posix functions and are not included in c99. Using the proton equivalents in util.h works. Let me know if you want me to commit that. Gah, sorry I should have spotted that myself earlier. I will fix it - I think the current solution we have for strncasecmp isn't great and I'll fix that at the same time. Should be fixed on master as of beaea0c1cc8237. Sorry, about that - I wonder if there's a way to stop non C99 symbols being visible, so that I won't keep on using strdup etc. thoughtlessly. Anyone have an idea? Would turning strict C99 mode on stop gcc from allowing POSIX only symbols? Andrew
Re: javascript appears to be broken again
On Wed, 2015-05-06 at 23:42 +0100, Gordon Sim wrote: ... Apparently these are posix functions and are not included in c99. Using the proton equivalents in util.h works. Let me know if you want me to commit that. Gah, sorry I should have spotted that myself earlier. I will fix it - I think the current solution we have for strncasecmp isn't great and I'll fix that at the same time. Andrew
Re: javascript appears to be broken again
On Wed, 2015-05-06 at 22:22 +0100, Gordon Sim wrote: [ 70%] Building C object proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/__/__/src/sasl/sasl.c.o /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:224:9: error: implicit declaration of function 'strncasecmp' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (strncasecmp(c, s.start, len)==0 (c[len]==' ' || c[len]==0) ) return true; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:363:44: error: implicit declaration of function 'strdup' is invalid in C99 [-Werror,-Wimplicit-function-declaration] sasl-config_dir = sasl_config_path ? strdup(sasl_config_path) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:363:42: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-config_dir = sasl_config_path ? strdup(sasl_config_path) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:414:29: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-password = password ? strdup(password) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:433:39: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-included_mechanisms = mechs ? strdup(mechs) : NULL; ^ ~ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:450:22: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Werror,-Wint-conversion] sasl-config_dir = strdup(dir); ^ ~~~ 6 errors generated. ERRORroot: compiler frontend failed to generate LLVM bitcode, halting make[2]: *** [proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/__/__/src/sasl/sasl.c.o] Error 1 make[1]: *** [proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/all] Error 2 I'm 99% certain I did a clean build a few hours ago, so I suspect its one of your latest commits Andrew(?) though I haven't actually verified Looks like sasl.c is not getting string.h anymore. I guess this is because the gcc compiler gets it through some other header file and clang is cleaner and doesn't. Try adding #include string.h at the top and see if it goes away. Sorry for that. A
Re: javascript appears to be broken again
On 05/06/2015 10:28 PM, Andrew Stitcher wrote: On Wed, 2015-05-06 at 22:22 +0100, Gordon Sim wrote: [ 70%] Building C object proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/__/__/src/sasl/sasl.c.o /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:224:9: error: implicit declaration of function 'strncasecmp' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (strncasecmp(c, s.start, len)==0 (c[len]==' ' || c[len]==0) ) return true; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:363:44: error: implicit declaration of function 'strdup' is invalid in C99 [-Werror,-Wimplicit-function-declaration] sasl-config_dir = sasl_config_path ? strdup(sasl_config_path) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:363:42: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-config_dir = sasl_config_path ? strdup(sasl_config_path) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:414:29: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-password = password ? strdup(password) : NULL; ^ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:433:39: error: pointer/integer type mismatch in conditional expression ('int' and 'void *') [-Werror,-Wconditional-type-mismatch] sasl-included_mechanisms = mechs ? strdup(mechs) : NULL; ^ ~ /home/gordon/projects/proton-git/proton-c/src/sasl/sasl.c:450:22: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Werror,-Wint-conversion] sasl-config_dir = strdup(dir); ^ ~~~ 6 errors generated. ERRORroot: compiler frontend failed to generate LLVM bitcode, halting make[2]: *** [proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/__/__/src/sasl/sasl.c.o] Error 1 make[1]: *** [proton-c/bindings/javascript/CMakeFiles/qpid-proton-bitcode.dir/all] Error 2 I'm 99% certain I did a clean build a few hours ago, so I suspect its one of your latest commits Andrew(?) though I haven't actually verified Looks like sasl.c is not getting string.h anymore. I guess this is because the gcc compiler gets it through some other header file and clang is cleaner and doesn't. Try adding #include string.h at the top and see if it goes away. No, same errors occur with that change (line numbers incremented by one).