mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Helge Deller <deller@gmx.de>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [kernel/ subdirectory] constifications
Date: Mon, 09 Oct 2006 20:22:34 +0200	[thread overview]
Message-ID: <1160418154.3000.244.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <200610092016.18362.deller@gmx.de>

On Mon, 2006-10-09 at 20:16 +0200, Helge Deller wrote:
> On Monday 09 October 2006 08:59, Arjan van de Ven wrote:
> > On Sun, 2006-10-08 at 21:21 +0200, Helge Deller wrote:
> > > - completely constify string arrays,  thus move them to the rodata section
> > 
> > note that gcc 4.1 and later will do this automatically for static things
> > at least...
> 
> Are you sure ?
> 
> At least with gcc-4.1.0 from SUSE 10.1 the strings array _pointers_ are not moved into the rodata section without the second "const":
> const static char * const x[] = { "value1", "value2" };
> 

hmm I could have sworn GCC does this automatic nowadays as long as it
can prove you're not writing to the thing (eg static and not passing the
pointer to some external function).....

(even if gcc does this perfect I'm still in favor of the explicit const,
just to catch stupid code with a warning)

-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com


  reply	other threads:[~2006-10-09 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 19:21 Helge Deller
2006-10-09  6:59 ` Arjan van de Ven
2006-10-09 18:16   ` Helge Deller
2006-10-09 18:22     ` Arjan van de Ven [this message]
2006-10-09 20:08       ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1160418154.3000.244.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=deller@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®