Background
So I did a little more digging and think the issue revolves around the fact that Clang version 15 and 16 come with new warnings;
for more information see https://www.redhat.com/en/blog/new-warnings-and-errors-clang-16. In particular error "ISO C99 and later do not support implicit int -Wimplicit-int"
Question
Is there any way to pass CFLAGS into the "perl install_cpan_modules.pl"?
Current Directory
hughdagg@Hughs-iMac jpeg % pwd
/Users/hughdagg/.cpanm/work/1724625386.12184/Tk-804.036/JPEG/jpeg
Run Default Configure
hughdagg@Hughs-iMac jpeg % ./configure
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler ca
+nnot create executables.
Log File
hughdagg@Hughs-iMac jpeg % cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:538: checking for gcc
configure:615: checking whether the C compiler (gcc ) works
configure:629: gcc -o conftest conftest.c 1>&5
configure:626:1: error: type specifier missing, defaults to 'int'; ISO
+ C99 and later do not support implicit int [-Wimplicit-int]
main(){return(0);}
^
int
1 error generated.
configure: failed program was:
#line 625 "configure"
#include "confdefs.h"
main(){return(0);}
Run Configure with c89 standard
hughdagg@Hughs-iMac jpeg % ./configure "CFLAGS=-std=c89"
checking for gcc... gcc
checking whether the C compiler (gcc -std=c89 ) works... yes
checking whether the C compiler (gcc -std=c89 ) is a cross-compiler...
+ no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline... __inline__
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... no
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
hughdagg@Hughs-iMac jpeg %
Log File
There are issues but the compiler flags turn them into warnings
hughdagg@Hughs-iMac jpeg % cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
configure:538: checking for gcc
configure:615: checking whether the C compiler (gcc -std=c89 ) works
configure:629: gcc -o conftest -std=c89 conftest.c 1>&5
configure:649: checking whether the C compiler (gcc -std=c89 ) is a cr
+oss-compiler
configure:654: checking whether we are using GNU C
configure:663: gcc -E conftest.c
configure:681: checking how to run the C preprocessor
configure:702: gcc -E conftest.c >/dev/null 2>conftest.out
configure:742: checking for function prototypes
configure:765: gcc -c -std=c89 conftest.c 1>&5
configure:792: checking for stddef.h
configure:802: gcc -E conftest.c >/dev/null 2>conftest.out
configure:828: checking for stdlib.h
configure:838: gcc -E conftest.c >/dev/null 2>conftest.out
configure:864: checking for string.h
configure:874: gcc -E conftest.c >/dev/null 2>conftest.out
configure:900: checking for size_t
configure:923: gcc -c -std=c89 conftest.c 1>&5
configure:994: checking for type unsigned char
configure:1003: gcc -c -std=c89 conftest.c 1>&5
configure:1018: checking for type unsigned short
configure:1027: gcc -c -std=c89 conftest.c 1>&5
configure:1042: checking for type void
configure:1072: gcc -c -std=c89 conftest.c 1>&5
configure:1088: checking for working const
configure:1142: gcc -c -std=c89 conftest.c 1>&5
configure:1163: checking for inline
configure:1174: gcc -c -std=c89 conftest.c 1>&5
configure:1224: checking for broken incomplete types
configure:1233: gcc -c -std=c89 conftest.c 1>&5
configure:1248: checking for short external names
configure:1260: gcc -o conftest -std=c89 conftest.c 1>&5
configure:1275: checking to see if char is signed
configure:1306: gcc -o conftest -std=c89 conftest.c 1>&5
configure:1295:5: error: implicitly declaring library function 'printf
+' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-de
+claration]
printf("Hmm, it seems 'char' is not eight bits wide on your machin
+e.\n");
^
configure:1295:5: note: include the header <stdio.h> or explicitly pro
+vide a declaration for 'printf'
configure:1302:3: error: implicitly declaring library function 'exit'
+with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-
+function-declaration]
exit(is_char_signed((int) signed_char_check));
^
configure:1302:3: note: include the header <stdlib.h> or explicitly pr
+ovide a declaration for 'exit'
2 errors generated.
configure: failed program was:
#line 1282 "configure"
#include "confdefs.h"
#ifdef HAVE_PROTOTYPES
int is_char_signed (int arg)
#else
int is_char_signed (arg)
int arg;
#endif
{
if (arg == 189) { /* expected result for unsigned char */
return 0; /* type char is unsigned */
}
else if (arg != -67) { /* expected result for signed char */
printf("Hmm, it seems 'char' is not eight bits wide on your machin
+e.\n");
printf("I fear the JPEG software will not work at all.\n\n");
}
return 1; /* assume char is signed otherwise */
}
char signed_char_check = (char) (-67);
main() {
exit(is_char_signed((int) signed_char_check));
}
configure:1323: checking to see if right shift is signed
configure:1358: gcc -o conftest -std=c89 conftest.c 1>&5
configure:1349:3: error: implicitly declaring library function 'printf
+' with type 'int (const char *, ...)' [-Werror,-Wimplicit-function-de
+claration]
printf("Right shift isn't acting as I expect it to.\n");
^
configure:1349:3: note: include the header <stdio.h> or explicitly pro
+vide a declaration for 'printf'
configure:1345:16: warning: shifting a negative signed value is undefi
+ned [-Wshift-negative-value]
res |= (~0L) << (32-4);
~~~~~ ^
configure:1354:3: error: implicitly declaring library function 'exit'
+with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-
+function-declaration]
exit(is_shifting_signed(-0x7F7E80B1L));
^
configure:1354:3: note: include the header <stdlib.h> or explicitly pr
+ovide a declaration for 'exit'
1 warning and 2 errors generated.
configure: failed program was:
#line 1328 "configure"
#include "confdefs.h"
#ifdef HAVE_PROTOTYPES
int is_shifting_signed (long arg)
#else
int is_shifting_signed (arg)
long arg;
#endif
/* See whether right-shift on a long is signed or not. */
{
long res = arg >> 4;
if (res == -0x7F7E80CL) { /* expected result for signed shift */
return 1; /* right shift is signed */
}
/* see if unsigned-shift hack will fix it. */
/* we can't just test exact value since it depends on width of long.
+.. */
res |= (~0L) << (32-4);
if (res == -0x7F7E80CL) { /* expected result now? */
return 0; /* right shift is unsigned */
}
printf("Right shift isn't acting as I expect it to.\n");
printf("I fear the JPEG software will not work at all.\n\n");
return 0; /* try it with unsigned anyway */
}
main() {
exit(is_shifting_signed(-0x7F7E80B1L));
}
configure:1375: checking to see if fopen accepts b spec
configure:1390: gcc -o conftest -std=c89 conftest.c 1>&5
configure:1385:5: error: implicitly declaring library function 'exit'
+with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-
+function-declaration]
exit(0);
^
configure:1385:5: note: include the header <stdlib.h> or explicitly pr
+ovide a declaration for 'exit'
1 error generated.
configure: failed program was:
#line 1380 "configure"
#include "confdefs.h"
#include <stdio.h>
main() {
if (fopen("conftestdata", "wb") != NULL)
exit(0);
exit(1);
}
configure:1436: checking for a BSD compatible install
configure:1488: checking for ranlib
configure:1650: checking libjpeg version number
hughdagg@Hughs-iMac jpeg %
|