opensource-cobol icon indicating copy to clipboard operation
opensource-cobol copied to clipboard

#INCLUDE problem in libcob/call.c

Open yutaro-sakamoto opened this issue 3 years ago • 1 comments

This is not a particularly important issue. When building opensource-cobol, make command displays the following warning message.

 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -MT libcob_la-call.lo -MD -MP -MF .deps/libcob_la-call.Tpo -c call.c  -fPIC -DPIC -o .libs/libcob_la-call.o
call.c: In function 'cob_init_call':
call.c:595:7: warning: implicit declaration of function 'strcasecmp' [-Wimplicit-function-declaration]
  595 |   if (strcasecmp (s, "LOWER") == 0) {
      | 

The function strcasecmp is defined in strings.h of C standard libraries. Even if #include<strings.h> is added to libcob/call.c, the warning will not be resolved. The cause of the above warning message is that #include <strings.h> refers to libcob/strings.h instead of strings.h of C standard libraries. (gcc finds libcob/strings.h first because of -I. option) I think it is necessary to update Makefile.am in order to fix the problem. Once I learn more about Automake and Autoconf, I will fix the warning message.

yutaro-sakamoto avatar Jun 03 '22 04:06 yutaro-sakamoto

The fix is to rename strings.h or get rid of it.

With https://github.com/opensourcecobol/opensource-cobol/commit/0871d148dd60a84ffd60686bbf413bd549138e15#diff-d908034303ac15afc0713b636b65d88b02a66ef39deefdea4a79a08a269d3611 you've backported the changelog "get rid of it", you likely either want to do it (placing it in common.h) or remove that ChangeLog entry when working on it.

GitMensch avatar Jun 03 '22 05:06 GitMensch