c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
3.02k stars 183 forks source link

Fix compile with gcc 14.2.1 #1594

Closed Waqar144 closed 3 weeks ago

Waqar144 commented 4 weeks ago

Fixes -Werror=maybe-uninitialized warnings

Waqar144 commented 4 weeks ago

There are also -Werror=format-overflow warnings in file_utils.c file_append_path_temp():

sprintf(path_buffer, "%s/%s", path, name);
...
sprintf(path_buffer, "%s%s", path, name);

I just locally added -Wno-format-overflow to avoid them for now.

lerno commented 3 weeks ago

Could we instead set these to an invalid value? So rather than null, perhaps (void)-1, and the len similarly. The best would be to add a #define like `#define NO_INIT_PTR (void)0xAAAAAAAA` or something.

lerno commented 3 weeks ago

Thank you!