[Bug analyzer/120213] analyzer report a false positive

2025-05-12 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120213 --- Comment #9 from Raffaello Bertini --- (In reply to David Malcolm from comment #8) > I'm not sure I fully grok the example code, but FWIW the analyzer doesn't > yet "know" about the behavior of strnlen and so conservatively assumes any > poss

[Bug analyzer/120213] analyzer report a false positive

2025-05-10 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120213 --- Comment #3 from Raffaello Bertini --- (In reply to Sam James from comment #2) > I can't reproduce that corrupted output. Did you get that from a CI system > or something like that? no i had that from the embedded terminal of the IDE VsCode

[Bug c/120213] New: analyzer report a false positive

2025-05-10 Thread raffaellobertini at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120213 Bug ID: 120213 Summary: analyzer report a false positive Product: gcc Version: 15.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c A

[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