Thank you for your bug report.
On Wed, 2025-05-28 at 20:20 +0200, Mohit Chamania wrote: > Hi > > I discovered that GLPK fails to build with GCC 15. > > Compiler details > gcc --version > gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2) > Copyright (C) 2025 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There > is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. > > I was attempting to build glpk-5.0 and this fails to build as the > minisat library uses a typedef to define booleans > > typedef int bool; > > #define true 1 > #define false 0 > > This fails to compile with the make command > > In file included from api/minisat1.c:23: > ./minisat/minisat.h:37:13: error: 'bool' cannot be defined via > 'typedef' > 37 | typedef int bool; > | ^~~~ > ./minisat/minisat.h:37:13: note: 'bool' is a keyword with '-std=c23' > onwards > ./minisat/minisat.h:37:1: warning: useless type name in empty > declaration > 37 | typedef int bool; > | ^~~~~~~ > > > > Replacing this with the use of > > #include <stdbool.h> > > fixes the issue and the make and make check commands work as > expected. Glpk is written in ANSI C as defined by "ANSI/ISO 9899-1990", and using features from more recent language versions in my opinion is not a good idea. Instead, you might pass -ansi option to gcc or specify it as CFLAGS="-ansi" on running configure script. > > Hope this is helpful. Please let me know if there is any other > information that you would need for the same. > > Regards > Mohit >
