giaf / blasfeo

Basic linear algebra subroutines for embedded optimization
Other
321 stars 88 forks source link

fixes implicit decl warning for posix_memalign with gcc 14.1 #175

Open hshose opened 5 months ago

hshose commented 5 months ago

Proposed fix for acados issue 1125

tmmsartor commented 4 months ago

This seems a problem compiling with flag -std=c99, when compiling with -std=gnuXX the macro __USE_XOPEN2K which enable posix_memalign declaration, is defined. This is true for both gcc13 and gcc14, there the default for -std is gnu17 but also older standards have same behaviors.

Anyway I don't think it is a good idea to add _POSIX_C_SOURCE in a part of the code that is enabled also for system which are potentially not POSIX. If this should work also for -std=cXX compilation I would suggest to modify blasfeo_malloc to have the proper macro enabled for the given system.

NB: I don't know why the behavior with -std=c99 changes between gcc13 and gcc14, but I would be happy to find out.

giaf commented 7 hours ago

This https://github.com/giaf/blasfeo/commit/01705e58f3cf88138749702e0f72831efb198be8 should make the job by removing any dependency on posix_memalign