From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 095CD397CF19; Fri, 15 May 2020 10:27:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 095CD397CF19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589538420; bh=bdxEmxNgis1F/pjI8Ai+yWH3/e/tXRKCZPIs4TL1fvs=; h=From:To:Subject:Date:From; b=AZLGxHpHkxk/36RJiyCbTzVT58iwNQcarE6faoLquxj7nfvVRX2gYtQnbNd39saTe kF9ZcnvRpuuRi7d/p8bO1Vhm7M8dG9TC8jczYBAa5QxsisNg5TTxejO41BvhTkPmkx QONzw/PO1tKuQYSjw6pkk/CtyLaMxV21LsKWkKXA= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95149] New: lex.c:1729:8: warning: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare] Date: Fri, 15 May 2020 10:26:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: Fri, 15 May 2020 10:27:00 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95149 Bug ID: 95149 Summary: lex.c:1729:8: warning: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Wstring-compare] Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org, nathan at gcc dot gnu.org Target Milestone: --- I see the following Clang warnings for lex.c. It comes from: 1729: BUF_APPEND ("\\", 1); #define BUF_APPEND(STR,LEN) \ do { \ bufring_append (pfile, (const uchar *)(STR), (LEN), \ &first_buff, &last_buff); \ total_len +=3D (LEN); \ if (__builtin_expect (temp_buffer_len < 17, 0) \ && (const uchar *)(STR) !=3D base \ && (LEN) <=3D 2) \ { \ memcpy (temp_buffer + temp_buffer_len, \ (const uchar *)(STR), (LEN)); \ temp_buffer_len +=3D (LEN); \ } \ } while (0) If I see correctly the problematic comparison is '(const uchar *)(STR) !=3D= base' which is really a comparison in between a string literal and a local variab= le.=