building 22.01.6 with gcc 13 fails
susurri opened this issue · 2 comments
susurri commented
./configure
and make
with gcc 13 fails. Error messages are as follows.
In file included from mercury_deconstruct.c:29:
mercury_ml_expand_body.h: In function ‘MR_expand_functor_args’:
mercury_ml_expand_body.h:1141:34: error: ‘%03lo’ directive writing between 3 and 22 bytes into a region of size 6 [-Werror=format-overflow=]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:39: note: format string is defined here
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mercury_ml_expand_body.h:1141:34: note: directive argument in the range [0, 18446744069414584479]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:21: note: ‘sprintf’ output between 8 and 27 bytes into a destination of size 8
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1142 | data_word);
| ~~~~~~~~~~
In file included from mercury_deconstruct.c:40:
mercury_ml_expand_body.h: In function ‘MR_expand_functor_args_limit’:
mercury_ml_expand_body.h:1141:34: error: ‘%03lo’ directive writing between 3 and 22 bytes into a region of size 6 [-Werror=format-overflow=]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:39: note: format string is defined here
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mercury_ml_expand_body.h:1141:34: note: directive argument in the range [0, 18446744069414584479]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:21: note: ‘sprintf’ output between 8 and 27 bytes into a destination of size 8
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1142 | data_word);
| ~~~~~~~~~~
In file included from mercury_deconstruct.c:50:
mercury_ml_expand_body.h: In function ‘MR_expand_functor_only’:
mercury_ml_expand_body.h:1141:34: error: ‘%03lo’ directive writing between 3 and 22 bytes into a region of size 6 [-Werror=format-overflow=]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:39: note: format string is defined here
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mercury_ml_expand_body.h:1141:34: note: directive argument in the range [0, 18446744069414584479]
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~
mercury_ml_expand_body.h:1141:21: note: ‘sprintf’ output between 8 and 27 bytes into a destination of size 8
1141 | sprintf(buf, "\'\\%03" MR_INTEGER_LENGTH_MODIFIER "o\\\'",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1142 | data_word);
| ~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/tmp/mmake.5O051E:1513: mercury_deconstruct.o] Error 1
make[2]: Leaving directory '/tmp/mercury-srcdist-22.01.6/runtime'
make[1]: *** [/tmp/mmake.E6IOiY:1052: runtime] Error 2
make[1]: Leaving directory '/tmp/mercury-srcdist-22.01.6'
make: *** [Makefile:30: all] Error 2
wangp commented
Fix committed to the master
branch. It should go on the 22.01 branch as well.
juliensf commented
A fix is available in 22.01.7-beta-2023-07-12.