[Bug libstdc++/90135] std::map::at incorrectly included in C++03 mode
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90135 --- Comment #3 from Andrew Gaul --- I understand; thank you for sharing this background.
[Bug libstdc++/90135] New: std::map::at incorrectly included in C++03 mode
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90135 Bug ID: 90135 Summary: std::map::at incorrectly included in C++03 mode Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc at gaul dot org Target Milestone: --- Created attachment 46191 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46191=edit Do not include std::map::at before C++11 This was introduced in C++11: https://en.cppreference.com/w/cpp/container/map/at
[Bug c/45821] New: no warning when returning a local variable address within a statement expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45821 Summary: no warning when returning a local variable address within a statement expression Product: gcc Version: unknown Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@gaul.org Created attachment 21904 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=21904 example of bug GCC warns when returning a local variable address within a function but not within a statement expression.
[Bug c/45821] no warning when returning a local variable address within a statement expression
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45821 --- Comment #3 from Andrew Gaul gcc at gaul dot org 2010-09-28 17:51:21 UTC --- The web form truncates all my attachedments at 244 bytes. Here is the source inline: /* * GCC warns about returning a local variable address within a function but not * within a statement expression: * * $ gcc statement_expression_return_local.c -c -Wall * statement_expression_return_local.c: In function ‘function_return_local’: * statement_expression_return_local.c:13: warning: function returns address of local variable */ int *function_return_local(void) { int x = 0; return x; } int *statement_expression_return_local(void) { int *y = ({ int x = 0; x; }); return y; }
[Bug c++/39554] -Wdisallowed-function-list fails when #including algorithm
--- Comment #4 from gcc at gaul dot org 2009-03-26 20:39 --- Thanks, r145094 fixed my problem! -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39554
[Bug c++/39554] New: -Wdisallowed-function-list fails when #including algorithm
-Wdisallowed-function-list with any value fails when #including algorithm. Tested with SVN r145051: $ gcc -dumpversion 4.4.0 $ cat disallow_fault.cc #if OPT == 1 #include algorithm #endif $ g++ -DOPT=0 -c -Wdisallowed-function-list=BOGUS disallow_fault.cc $ g++ -DOPT=1 -c -Wdisallowed-function-list=BOGUS disallow_fault.cc In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/bits/stl_pair.h:65, from /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/bits/stl_algobase.h:71, from /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/algorithm:66, from disallow_fault.cc:2: /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/bits/move.h: In function void std::swap(_Tp ()[_Nm], _Tp ()[_Nm]): /usr/local/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/bits/move.h:98: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html for instructions. -- Summary: -Wdisallowed-function-list fails when #including algorithm Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gcc at gaul dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39554
[Bug c++/39089] -Wconversion is buggy with bitwise operators
--- Comment #2 from gcc at gaul dot org 2009-02-03 18:40 --- Original description is not quite accurate, the or operator does not cause a spurious warning while the and operator does. Here is a more minimal test case: void func(char a, char b, char c) { c = a | b; c = a b; c = a | 0x20; c = a 0x20; // warn } I do not get the spurious warning in SVN from 20090109. -- gcc at gaul dot org changed: What|Removed |Added CC||gcc at gaul dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39089
[Bug c++/39089] -Wconversion is buggy with bitwise operators
--- Comment #3 from gcc at gaul dot org 2009-02-03 18:57 --- After talking with Oleg, there are differences between gcc and g++ compiling the code in comment #2: $ g++ --version g++ (GCC) 4.3.0 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -Wconversion and_or_conversion.c -c and_or_conversion.c: In function void func(char, char, char): and_or_conversion.c:3: warning: conversion to char from int may alter its va lue and_or_conversion.c:4: warning: conversion to char from int may alter its va lue and_or_conversion.c:6: warning: conversion to char from int may alter its va lue $ gcc -Wconversion and_or_conversion.c -c and_or_conversion.c: In function func: and_or_conversion.c:6: warning: conversion to char from int may alter its va lue I get the same results with GCC 4.3.2 as packaged by Fedora 10: $ g++ --version g++ (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39089
[Bug c++/31843] New: -Wformat-nonliteral differs between gcc and g++
$ gcc -dumpversion 4.1.1 $ g++ -dumpversion 4.1.1 $ gcc -Wall -Wformat-nonliteral format_nonliteral.c $ g++ -Wall -Wformat-nonliteral format_nonliteral.c format_nonliteral.c: In function int main(int, char**): format_nonliteral.c:10: warning: format not a string literal, argument types not checked -- Summary: -Wformat-nonliteral differs between gcc and g++ Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: gcc at gaul dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31843
[Bug c++/31843] -Wformat-nonliteral differs between gcc and g++
--- Comment #1 from gcc at gaul dot org 2007-05-06 08:10 --- Created an attachment (id=13515) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13515action=view) -Wformat-nonliteral test case -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31843