@@ -152,8 +152,16 @@ def flag_handler(self, name, flags):
152152 flags .append ("-Wno-error=implicit-int" )
153153 flags .append ("-std=gnu17" )
154154
155- # Testing shows we need one extra flag for gcc@14
156- if self .spec .satisfies ("%gcc@14:" ):
155+ # Newer compilers promote -Wincompatible-pointer-types from a warning
156+ # to an error. This is not gcc-specific: clang 16+, and oneAPI's
157+ # clang-based icx, reject the same code (58 errors in EHapi/GDapi/
158+ # PTapi/SWapi.c passing 'long *' where 'int32 *' is expected).
159+ if (
160+ self .spec .satisfies ("%clang@16:" )
161+ or self .spec .satisfies ("%apple-clang@15:" )
162+ or self .spec .satisfies ("%oneapi" )
163+ or self .spec .satisfies ("%gcc@14:" )
164+ ):
157165 flags .append ("-Wno-error=incompatible-pointer-types" )
158166 return flags , None , None
159167
@@ -180,9 +188,15 @@ def setup_build_environment(self, env: EnvironmentModifications) -> None:
180188 or self .spec .satisfies ("%oneapi" )
181189 or self .spec .satisfies ("%gcc@14:" )
182190 ):
191+ # NOTE: this env.set REPLACES the cflags computed in
192+ # flag_handler above (the build uses CC=h4cc with these CFLAGS),
193+ # so every flag needed there must be repeated here.
183194 env .set (
184195 "CFLAGS" ,
185- "-Wno-error=implicit-function-declaration -Wno-error=implicit-int -std=gnu17" ,
196+ "-Wno-error=implicit-function-declaration "
197+ "-Wno-error=implicit-int "
198+ "-Wno-error=incompatible-pointer-types "
199+ "-std=gnu17" ,
186200 )
187201
188202 @run_before ("configure" , when = "@3.0" )
0 commit comments