Build fails with GCC 14. This blocks GCC_DEFAULT update to GCC 14. gcc14 -DHAVE_CONFIG_H -I. -I.. -I../src -I/usr/local/include/guile/2.2 -I/usr/local/include -D_THREAD_SAFE -pthread -I../src/util -I../src/matrices -I../src/matrixio -I../src/maxwell -DHAVE_CTL_HOOKS=1 -DHAVE_CTL_EXPORT_HOOK=1 -DCTL_SCM='"'/usr/local/share/libctl/base/ctl.scm'"' -DINCLUDE_SCM='"'/usr/local/share/libctl/base/include.scm'"' -DSPEC_SCM='"'/usr/local/share/mpb/mpb.scm'"' -DVERSION_STRING='"'"mpb 1.11.1, Copyright (C) 1999-2012, MIT"'"' -I/usr/local/include -I/usr/local/include -O2 -pipe -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc14 -fno-strict-aliasing -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -MT mpb-field-smob.o -MD -MP -MF .deps/mpb-field-smob.Tpo -c -o mpb-field-smob.o `test -f 'field-smob.c' || echo './'`field-smob.c In file included from /usr/local/include/guile/2.2/libguile.h:38, from /usr/local/include/ctl.h:28, from ctl-io.h:7, from field-smob.h:21, from field-smob.c:27: field-smob.c: In function 'field_p': my-smob.h:53:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'long int' [-Wsign-compare] 53 | && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) | ^~ field-smob.h:45:20: note: in expansion of macro 'T_SMOB_P' 45 | #define FIELD_P(X) T_SMOB_P(field_smob, X) | ^~~~~~~~ field-smob.c:42:40: note: in expansion of macro 'FIELD_P' 42 | return ctl_convert_boolean_to_scm(FIELD_P(obj)); | ^~~~~~~ field-smob.c: In function 'rscalar_field_p': my-smob.h:53:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'long int' [-Wsign-compare] 53 | && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) | ^~ field-smob.h:45:20: note: in expansion of macro 'T_SMOB_P' 45 | #define FIELD_P(X) T_SMOB_P(field_smob, X) | ^~~~~~~~ field-smob.h:49:29: note: in expansion of macro 'FIELD_P' 49 | #define RSCALAR_FIELD_P(X) (FIELD_P(X) && ((FIELD(X))->type == RSCALAR_FIELD_SMOB)) | ^~~~~~~ field-smob.c:47:40: note: in expansion of macro 'RSCALAR_FIELD_P' 47 | return ctl_convert_boolean_to_scm(RSCALAR_FIELD_P(obj)); | ^~~~~~~~~~~~~~~ field-smob.c: In function 'cscalar_field_p': my-smob.h:53:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'long int' [-Wsign-compare] 53 | && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) | ^~ field-smob.h:45:20: note: in expansion of macro 'T_SMOB_P' 45 | #define FIELD_P(X) T_SMOB_P(field_smob, X) | ^~~~~~~~ field-smob.h:50:29: note: in expansion of macro 'FIELD_P' 50 | #define CSCALAR_FIELD_P(X) (FIELD_P(X) && ((FIELD(X))->type == CSCALAR_FIELD_SMOB)) | ^~~~~~~ field-smob.c:52:40: note: in expansion of macro 'CSCALAR_FIELD_P' 52 | return ctl_convert_boolean_to_scm(CSCALAR_FIELD_P(obj)); | ^~~~~~~~~~~~~~~ field-smob.c: In function 'cvector_field_p': my-smob.h:53:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'long int' [-Wsign-compare] 53 | && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) | ^~ field-smob.h:45:20: note: in expansion of macro 'T_SMOB_P' 45 | #define FIELD_P(X) T_SMOB_P(field_smob, X) | ^~~~~~~~ field-smob.h:51:29: note: in expansion of macro 'FIELD_P' 51 | #define CVECTOR_FIELD_P(X) (FIELD_P(X) && ((FIELD(X))->type == CVECTOR_FIELD_SMOB)) | ^~~~~~~ field-smob.c:57:40: note: in expansion of macro 'CVECTOR_FIELD_P' 57 | return ctl_convert_boolean_to_scm(CVECTOR_FIELD_P(obj)); | ^~~~~~~~~~~~~~~ In file included from field-smob.h:22: field-smob.c: In function 'field2scm': my-smob.h:42:6: error: implicit declaration of function 'SCM_NEWCELL' [-Wimplicit-function-declaration] 42 | SCM_NEWCELL((ANSWER)); \ | ^~~~~~~~~~~ field-smob.c:102:6: note: in expansion of macro 'NEWCELL_SMOB' 102 | NEWCELL_SMOB(obj, field_smob, pf); | ^~~~~~~~~~~~ field-smob.c:102:6: error: assignment to 'SCM' {aka 'struct scm_unused_struct *'} from 'long int' makes pointer from integer without a cast [-Wint-conversion] field-smob.c: In function 'assert_field_smob': my-smob.h:53:44: warning: comparison of integer expressions of different signedness: 'long unsigned int' and 'long int' [-Wsign-compare] 53 | && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) | ^~ my-smob.h:66:28: note: in expansion of macro 'T_SMOB_P' 66 | #define SAFE_T_SMOB(T, X) (T_SMOB_P(T,X) ? T_SMOB(T,X) : NULL) | ^~~~~~~~ field-smob.h:47:65: note: in expansion of macro 'SAFE_T_SMOB' 47 | #define SAFE_FIELD(X) (cur_fieldp(X) ? update_curfield_smob() : SAFE_T_SMOB(field_smob, X)) | ^~~~~~~~~~~ field-smob.c:187:22: note: in expansion of macro 'SAFE_FIELD' 187 | field_smob *f = SAFE_FIELD(fo); | ^~~~~~~~~~ field-smob.c: In function 'integrate_fieldL': field-smob.c:407:54: warning: variable 'last_dim' set but not used [-Wunused-but-set-variable] 407 | int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; | ^~~~~~~~ field-smob.c:407:48: warning: variable 'rank' set but not used [-Wunused-but-set-variable] 407 | int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; | ^~~~ field-smob.c:407:40: warning: variable 'n_last' set but not used [-Wunused-but-set-variable] 407 | int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; | ^~~~~~ field-smob.c:407:31: warning: variable 'n_other' set but not used [-Wunused-but-set-variable] 407 | int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; | ^~~~~~~ field-smob.c: At top level: field-smob.c:395:17: warning: 'cvector3_conj' defined but not used [-Wunused-function] 395 | static cvector3 cvector3_conj(cvector3 c) | ^~~~~~~~~~~~~ *** Error code 1 Stop. make[3]: stopped in /wrkdirs/usr/ports/science/mpb/work/mpb-1.11.1/mpb *** Error code 1 Stop. make[2]: stopped in /wrkdirs/usr/ports/science/mpb/work/mpb-1.11.1/mpb *** Error code 1 Stop. make[1]: stopped in /wrkdirs/usr/ports/science/mpb/work/mpb-1.11.1 *** Error code 1 Stop. make: stopped in /wrkdirs/usr/ports/science/mpb/work/mpb-1.11.1 *** Error code 1 Stop. Full log: https://pkg-status.freebsd.org/gohan04/data/140amd64-default-foo/2024-08-29_19h57m48s/logs/errors/mpb-1.11.1_8.log Useful link: https://gcc.gnu.org/gcc-14/porting_to.html
Hi Lorenzo, Thanks for the report. I must confess that with my very limited knowledge of C/C++ I have not yet found a solution. In fact, there was already an issue in the mpb project on Github [1], in which a two patches are suggested. However, these did not eliminate the actual error with SCM_NEWCELL for me. I haven't gotten any further so far, but I could use some help from here on. P.S.: I'm AFK until Sept 27, so I can't help or test until then. [1] https://github.com/NanoComp/mpb/issues/165