Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752778AbbBMLWF (ORCPT ); Fri, 13 Feb 2015 06:22:05 -0500 Received: from smtp-out6.electric.net ([192.162.217.187]:57426 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbbBMLWD convert rfc822-to-8bit (ORCPT ); Fri, 13 Feb 2015 06:22:03 -0500 From: David Laight To: "'Rasmus Villemoes'" , Mark Rustad CC: "Rustad, Mark D" , Stanislaw Gruszka , Kalle Valo , "linux-wireless@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] iwl4965: Enable checking of format strings Thread-Topic: [PATCH] iwl4965: Enable checking of format strings Thread-Index: AQHQR3k/Qkf4l055/U6HMwwxhWldepzubg+A Date: Fri, 13 Feb 2015 11:20:47 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CAE3325@AcuExch.aculab.com> References: <1423695069-23436-1-git-send-email-linux@rasmusvillemoes.dk> <60178C37-F104-430E-92EB-B6DDFAEB2F99@intel.com> <87vbj7zb0e.fsf@rasmusvillemoes.dk> <54DDAE03.4000502@gmail.com> <87y4o2xfgz.fsf@rasmusvillemoes.dk> In-Reply-To: <87y4o2xfgz.fsf@rasmusvillemoes.dk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 780 Lines: 21 From: Rasmus Villemoes > Well, probably the linker is allowed to overlap "anonymous" objects > (string literals) with whatever const char[] (or indeed any const) > object it finds containing the appropriate byte sequence. But I think > language lawyers would insist that for > > const char foo[] = "a string"; > const char bar[] = "a string"; A quick test shows those are separate strings. But 'const char *foo = "xxx";' will share. You also need -O1 to get the strings into .rodata.str.n so that the linker can merge them. David -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/