From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 6E9E03858D35 for ; Thu, 3 Feb 2022 18:45:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E9E03858D35 Received: by mail-pg1-x52d.google.com with SMTP id s16so2976808pgs.13 for ; Thu, 03 Feb 2022 10:45:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RovCWPyOvJREP+G6uMtrghJ6/Irq2ADdynPNve4Ilf0=; b=3/5ZvMca5bF+SjY4vhcAMFcRR7s+6jyHIOpJtCxz1I00iwDzZr6MghV0maKilWY/0g HHAwaazApKm5BcfbhAeESHCwevENHiHoPUlFIiGK8kmivGA/XPTMD8xRtE1OPbHemp2h 0V0LioDGXsExXqWYc86dv5sPMSW45NYg/FJDsIfbZ2yu2R4cqjN1BR2xxriWjTvj4TQ2 hHMTDL46nhG4fgKx6EwKrE9H8qY6NJviL5qCH7KEw05nLgKRU2pv4iQhLl1BOd1TGS6D Is1eCdrd6FJpdyz8sTnx2Xeyi77hzqQK4WTejTaYHxL/ftigf7cRkJgkh9NOkrT35jUI kPNg== X-Gm-Message-State: AOAM5300Ovl7PjU0bz2kpbFkcHwvXkP7G0iJupKPKWInjBafx+nq4BwV thx2MZQ/7rgjT3OEgVfzDIobs6q8wCxcHI/HOdGvKlHoXEQ= X-Google-Smtp-Source: ABdhPJzUTZ1o00RH1U07TCdrA+JDcBHZx6byFphiy3mDyxpaoxUjFkO5YiBSmCWv0oBgCZ25qykzXtcqhFGhgKyL0j0= X-Received: by 2002:a63:8641:: with SMTP id x62mr28608350pgd.563.1643913957137; Thu, 03 Feb 2022 10:45:57 -0800 (PST) MIME-Version: 1.0 From: Krishna Narayanan Date: Fri, 4 Feb 2022 00:15:45 +0530 Message-ID: Subject: Doubts regarding the issue (bug 62181) To: gcc-help X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2022 18:46:00 -0000 Respected Sir/Madam, I have been working on an issue (bug 62181) [C/C++] Expected new warning: "adding 'char' to a string does not append to the string" [-Wstring-plus-int].This is asking for a warning being added to gcc for such a case.Not using concat and indexing which were mentioned earlier as a solution to the warning I tried the example given in https://godbolt.org/ and was trying different permutations of addresses and pointers in clang and gcc (trunk), I am not sure but I tried '-w' in compiler flags and it worked fine for both clang and gcc ,it did not show any warning.I am not sure what exactly did the flag do but the warning arises in other optimizations. I had a doubt regarding the output of a slightly modified code in which I have taken a character instead of int , #include char ch ='o'; char bar() { return 1; } int foobar() { return ch; } int main() { const char* a = "aa"; const char *b = "bb" + bar(); const char *c = "cc" + foobar(); printf("%s, %s, %s", a, b, c); return 0 ; } In the output I get zR when I did it with gcc and get unicode when done with g++10.1 .I did not understand how does this output arise.Can you please help me out with this? Please correct me if I am going wrong somewhere. Hoping for your reply soon. Thanks and Regards, Krishna Narayanan.