From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 684B93858405; Wed, 27 Apr 2022 11:58:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 684B93858405 From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105401] Improved diagnostics for code from "Labels as Values" documentation Date: Wed, 27 Apr 2022 11:58:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic, documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2022 11:58:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105401 --- Comment #1 from Eric Gallager --- Actually never mind about point 3: I do actually get warnings from -Winline when I turn on optimizations: $ /usr/local/bin/gcc -c -Wall -Wextra -Wc++-compat -Winline -O2 labels_as_values.c labels_as_values.c: In function 'asdf': labels_as_values.c:3:19: warning: function 'asdf' can never be copied becau= se it saves address of local label in a static variable [-Winline] 3 | static inline int asdf(void) | ^~~~ labels_as_values.c: In function 'zxcv': labels_as_values.c:18:19: warning: function 'zxcv' can never be copied beca= use it saves address of local label in a static variable [-Winline] 18 | static inline int zxcv(int i) | ^~~~ labels_as_values.c: In function 'qwerty': labels_as_values.c:3:19: warning: inlining failed in call to 'asdf': functi= on not inlinable [-Winline] 3 | static inline int asdf(void) | ^~~~ labels_as_values.c:36:30: note: called from here 36 | return (zxcv(array[i]) + asdf()); | ^~~~~~ labels_as_values.c:18:19: warning: inlining failed in call to 'zxcv': funct= ion not inlinable [-Winline] 18 | static inline int zxcv(int i) | ^~~~ labels_as_values.c:36:13: note: called from here 36 | return (zxcv(array[i]) + asdf()); | ^~~~~~~~~~~~~~ $ Points 1 and 2 still stand, though.=