All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: cutaway@bellsouth.net
Cc: Jean Delvare <khali@linux-fr.org>,
	Denis Vlasenko <vda@ilport.com.ua>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] cleanup patches for strings
Date: Tue, 21 Jun 2005 20:16:26 -0400	[thread overview]
Message-ID: <42B8ADDA.6060000@didntduck.org> (raw)
In-Reply-To: <00d501c576b6$943da300$2800000a@pc365dualp2>

cutaway@bellsouth.net wrote:
> There is a way to defeat the GCC string alignments by putting the strings in
> a dynamically sized structure if anyone cares.  A bonus side effect of this
> scheme is that kernel/driver NLS translations would become almost trivial
> because all the string texts are collected in one place.
> 
> The basic idea looks like this:
> 
> #define MSG1 "Message text blah"
> #define MSG2 "Message text blah, blah"
> #define MSG3 "Message text blah, blah, blah"
> 
> #ifndef __GCC_FORMAT_STRING_CHECKS__
> static const struct
>     {
>     char m1[sizeof(MSG1)+1];
>     char m2[sizeof(MSG2)+1];
>     char m3[sizeof(MSG3)+1];
>     } msg = {
>     {MSG1},
>     {MSG2},
>     {MSG3}
>     };
> #undef MSG1
> #undef MSG2
> #undef MSG3
> #define MSG1 msg.m1
> #define MSG2 msg.m2
> #define MSG3 msg.m3
> #endif
> 

Sometimes the cure is worse than the disease.

--
				Brian Gerst

  reply	other threads:[~2005-06-22  0:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 22:46 [RFC] cleanup patches for strings Jesper Juhl
2005-06-21  6:58 ` cutaway
2005-06-21 11:02   ` Denis Vlasenko
2005-06-21 13:08     ` cutaway
2005-06-21 13:06       ` Denis Vlasenko
2005-06-21 14:38         ` cutaway
2005-06-21 13:52           ` Denis Vlasenko
2005-06-21 13:20       ` Denis Vlasenko
2005-06-21  8:59 ` Alexey Dobriyan
2005-06-21  9:31   ` Jörn Engel
2005-06-21 20:47     ` Jesper Juhl
2005-06-21  9:04 ` Andrey Panin
2005-06-21 10:59 ` Denis Vlasenko
2005-06-21 21:24   ` Jean Delvare
2005-06-21 22:33     ` cutaway
2005-06-21 21:49       ` Jean Delvare
2005-06-21 23:11         ` cutaway
2005-06-22  0:16           ` Brian Gerst [this message]
2005-06-21 21:12 ` Horst von Brand

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=42B8ADDA.6060000@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=cutaway@bellsouth.net \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vda@ilport.com.ua \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.