[Bug c/118308] compiling code that should return without a return statement

2025-01-05 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118308 --- Comment #3 from Raffaello Bertini --- ok thanks for the reply. btw it is enough to enable the warnigs. ``` bool f() { printf("f"); } int main(int argc, char* argv[]) { if (f()) printf("y"); else printf("n");

[Bug c/118308] New: compiling code that should return without a return statement

2025-01-05 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118308 Bug ID: 118308 Summary: compiling code that should return without a return statement Product: gcc Version: 14.1.0 Status: UNCONFIRMED Severity: normal

[Bug c/116767] C const function pointer no code generated (or optimized out)

2024-09-19 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767 --- Comment #11 from Raffaello Bertini --- > MyFunc __attribute__((const)) * g_f = my_func; > instead. Just with the attribute syntax you get an extra warning: > warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] That's f

[Bug c/116767] C const function pointer no code generated (or optimized out)

2024-09-19 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767 --- Comment #9 from Raffaello Bertini --- More than to fix something, it was a suggestion to evolve or add a warning to tell the user that those kind of statements are basically like not written at all, ignored as the final result. so more than

[Bug c/116767] C const function pointer no code generated (or optimized out)

2024-09-18 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767 --- Comment #1 from Raffaello Bertini --- for simplicity sake i am writing here the C sample code: #include typedef void MyFunc(void); const MyFunc my_func; co

[Bug c/116767] New: C const function pointer no code generated (or optimized out)

2024-09-18 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116767 Bug ID: 116767 Summary: C const function pointer no code generated (or optimized out) Product: gcc Version: 14.2.1 Status: UNCONFIRMED Severity: normal