This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/55896] Annoying compiler warning
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Mar 2014 11:38:18 +0000
- Subject: [Bug c/55896] Annoying compiler warning
- Auto-submitted: auto-generated
- References: <bug-55896-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55896
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But there is && content_1[0] == '[' guard around it, but likely just no
optimization figures out that the inlined w_strlen (why aren't you using
strlen???) will always return at least 1 and thus the jump threaded variant
with zero length is dead. I suppose instead of using w_strlen (contents_1) - 1
you could just use w_strlen (contents_1 + 1) and the warning could go away.