[Bug tree-optimization/109290] warning: array subscript -50 is outside array bounds of ‘struct kobject[36028797018963967]’

2023-12-16 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109290 lavr at ncbi dot nlm.nih.gov changed: What|Removed |Added CC||lavr at ncbi dot

[Bug middle-end/104069] Wuse-after-free=2 -O0 false positive "may be used"

2023-12-16 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069 lavr at ncbi dot nlm.nih.gov changed: What|Removed |Added CC||lavr at ncbi dot

[Bug libstdc++/108561] std::endl causes a flush on a bad stream

2023-01-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108561 --- Comment #3 from lavr at ncbi dot nlm.nih.gov --- Also, the standard seems to mention that flush() is an "unformatted output function", meaning it is supposed to build and check a sentry object (which in case of a bad stream, woul

[Bug libstdc++/108561] std::endl causes a flush on a bad stream

2023-01-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108561 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- Indeed, it does not. But the reason the endl manipulator is there, is to flush _after_ '\n'. If the stream has gone bad in between, it is the gray area, but for the output device (

[Bug libstdc++/108561] New: std::endl causes a flush on a bad stream

2023-01-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- As implemented: template inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { return flush(__o

[Bug c/107465] New: Bogus warning: promoted bitwise complement of an unsigned value is always nonzero

2022-10-30 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- Tried on both Ubuntu and Cygwin, the same gcc-11.3.0 -- and the same problem: $ gcc --version gcc (Ubuntu 11.3.0

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2022-07-07 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 --- Comment #10 from lavr at ncbi dot nlm.nih.gov --- > In your code, `&a->record.data[0]` is not a well-aligned access It is well-aligned, its offset gets printed out by the very test code, and it's 2. > because `struct att

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2022-07-06 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 --- Comment #8 from lavr at ncbi dot nlm.nih.gov --- Consider the following code: struct record { unsigned char len; unsigned short data[5]; } __attribute__((packed)); struct attribute { unsigned char code; struct record

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2022-07-06 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 --- Comment #7 from lavr at ncbi dot nlm.nih.gov --- The problem with the aligned(4) attribute is that if this structure appears as a member of an outer packed structure, it may not be "enclosed" properly without a gap. The wa

[Bug middle-end/106092] Bogus -Wfree-nonheap-object

2022-06-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106092 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- Created attachment 53201 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53201&action=edit preprocessed source Attached! It's rather big

[Bug c++/106092] New: Bogus -Wfree-nonheap-object

2022-06-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- I got the following report from the compilation: In file included from /home/ANTON/cxx/src/util/qparse/parser.cpp:352: query_parser_bison.tab.c: In function ‘int ncbi_q_parse(void

[Bug tree-optimization/103835] bogus sprintf warnings due to missing strlen propagation

2022-01-05 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103835 --- Comment #4 from lavr at ncbi dot nlm.nih.gov --- Thank you for investigating this! Like I said, it's better NOT to emit any warnings if some machinery in the compiler is not perfect enough to recognize the danger correctly (as it used

[Bug tree-optimization/103835] Bogus sprintf warnings

2021-12-27 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103835 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- Irrespective of whether atoi() is known, printing an "int" (or two) will never produce this many characters... This, however, also seems to have triggered some weird logic tha

[Bug c/103835] New: Bogus sprintf warnings

2021-12-26 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- Please address these warnings because they create more noise than they help! $ cat test.c #include #include #include const char* fun(char* buf, const char* pfx, int a, int b) { sprintf

[Bug c/100403] Bogus "function may return address of local variable" warning

2021-05-03 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100403 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- > undefined if msg is not in the range of x.rec[0]...x.rec[RECLEN] Indeed for the segmented data address space. But in most systems it's linear, and the warning is then arch

[Bug middle-end/100401] Bogus -Wformat-overflow for a trailing zero-length array of a union

2021-05-03 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100401 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- > GCC warnings are designed to "report constructions that are not inherently > erroneous but that are risky or suggest there may have been an error." Certainly, but the [

[Bug c/100403] New: Bogus "function may return address of local variable" warning

2021-05-03 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
ty: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- $ gcc --version gcc (GCC) 10.2.0 $ cat test.c #include #include #define RECLEN 128 struct R { int head;

[Bug c/100401] New: Bogus -Wformat-overflow warning

2021-05-03 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- $ gcc --version gcc (GCC) 10.2.0 $ cat bogus.c #include #define RECLEN 128 struct S { int code; char text[0]; }; const void fun(int n) { union { struct S s

[Bug c/100395] New: Bogus -Wstringop-overflow warning

2021-05-03 Thread lavr at ncbi dot nlm.nih.gov via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- $ gcc --version gcc (GCC) 10.2.0 $ cat test.c #include #include int main(int argc, const char* argv[]) { size_t len0 = strlen(argv[0]), len1 = strlen(argv[1]); char buf[444

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2020-07-27 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 --- Comment #5 from lavr at ncbi dot nlm.nih.gov --- My test case is not invalid. You're talking about base address of a structure, which would make offsets within it all unaligned, which is why I said "the same rule should apply for

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2020-07-23 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 lavr at ncbi dot nlm.nih.gov changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2020-07-23 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- I don't want my structure to be aligned at the int boundary. I want my structure to reflect the actual data layout "byte","byte","short","int&quo

[Bug c/96293] New: Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

2020-07-22 Thread lavr at ncbi dot nlm.nih.gov
NCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- Hi, Beginning version 9 GCC started to generate tons of warnings of "unaligned pointer valu

[Bug c/89694] New: Redundant code with optimization

2019-03-12 Thread lavr at ncbi dot nlm.nih.gov
Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- When I use the -O6 optimization, I noticed that GCC 7.4.0 interjects some redundant code, like marked below: mulP: .seh_endprologue movq%rcx, %r10 movq%rdx

[Bug middle-end/89230] Bogus uninited usage warning

2019-02-12 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89230 --- Comment #6 from lavr at ncbi dot nlm.nih.gov --- That said, any function call within the outer "if()" but before the inner "if()" would cause the warning, even if that call does not accept any pointers (and thus cannot

[Bug middle-end/89230] Bogus uninited usage warning

2019-02-12 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89230 --- Comment #5 from lavr at ncbi dot nlm.nih.gov --- Thank you Martin, for giving me the idea of where the problem might be stemming from! It does look like *printf() is not recognized by GCC as not modifying the local memory. But in your

[Bug middle-end/89230] Bogus uninited usage warning

2019-02-07 Thread lavr at ncbi dot nlm.nih.gov
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89230 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- Okay, but "d" points to a clearly separate storage on stack within a local frame. None of the pointers passed to (s)printf() relate to that area (either they are also clearly separ

[Bug c/89230] New: Bogus uninited usage warning

2019-02-06 Thread lavr at ncbi dot nlm.nih.gov
Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- I have a piece of code that reads like this (line numbers added): 2401 if (d->D_fid[2] || !(hdr = getfh(vol, d->D_fid[0], tmp)) || d->D_fid[1] != hdr->H_fse

[Bug c/89161] New: Bogus -Wformat-overflow warning with value range known

2019-02-02 Thread lavr at ncbi dot nlm.nih.gov
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Target Milestone: --- The following code $ cat bogus1.c #include static char* print(const unsigned short a[2]) { static char buf[3]; if (a[0] && a[0] < a[1])

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-04-11 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #10 from lavr at ncbi dot nlm.nih.gov --- > I guess also a dup of PR57201. While I can agree these cases (and the one mentioned within PR57201) look similar, the gravity of the disappearing warning in case of a mismatched type is m

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-03-24 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #8 from lavr at ncbi dot nlm.nih.gov --- This is the code from the original .c file that fails to post a warning. sock->w_len -= BUF_PeekAtCB(sock->w_buf, BUF_Size(sock->w_buf) - so

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-03-24 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #6 from lavr at ncbi dot nlm.nih.gov --- The .c file has a lot of headers included. Do you want all of them, as well? OTOH, the code in the preprocessed file clearly shows the use of a function pointer of mismatched type gone un

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-02-06 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #4 from lavr at ncbi dot nlm.nih.gov --- Created attachment 32072 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32072&action=edit Preprocessed C source that fails to produce a warning when compiled

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-02-06 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #3 from lavr at ncbi dot nlm.nih.gov --- Ok, sorry and let me start again. My original mockup case wasn't good enough. So attached is the real (preprocessed) code that fails to produce a warning (yet when compiled from the .c

[Bug c/60100] warning disappears when preprocessed source is compiled

2014-02-06 Thread lavr at ncbi dot nlm.nih.gov
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60100 --- Comment #2 from lavr at ncbi dot nlm.nih.gov --- > Because your command line did not actual compile anything. Indeed. with .i I see the warning again. But I can't see any warning if the precompiled file is processed through distcc...

[Bug c/60100] New: warning disappears when preprocessed source is compiled

2014-02-06 Thread lavr at ncbi dot nlm.nih.gov
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: lavr at ncbi dot nlm.nih.gov Created attachment 32070 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32070&action=edit GCC specs are attached Hello, When compiling the attached C code w