public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: John Hawkes <hawkes@oss.sgi.com>,
	linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [PATCH] gcc 3.0.1 warnings about multi-line literals
Date: Mon, 22 Oct 2001 16:51:57 -0400	[thread overview]
Message-ID: <20011022165157.M23213@redhat.com> (raw)
In-Reply-To: <20011022161527.K23213@redhat.com> <E15vlx2-0003HO-00@the-village.bc.nu>
In-Reply-To: <E15vlx2-0003HO-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Mon, Oct 22, 2001 at 09:45:36PM +0100

On Mon, Oct 22, 2001 at 09:45:36PM +0100, Alan Cox wrote:
> > On Mon, Oct 22, 2001 at 01:05:10PM -0700, John Hawkes wrote:
> > > This patch eliminates gcc 3.0.1 warnings, "multi-line string literals are
> > > deprecated", in two include/asm-i386 files.  Patches cleanly for at least
> > > 2.4.10 and 2.4.12, and tested in 2.4.10.
> > 
> > Please reject this patch.  The gcc folks are wrong in this case.
> 
> Im curious - why do you make that specific claim. The multiline literals are
> rather ugly.

Which of the following is more readable:

/* try atomic lock inline, if that fails, spin out of line */
	"\tbtsl $1,%0\n"
	"\tbne 2f\n"
	"1:\n"
	"\t.section .text.lock\n\n"
	"\t2:\tcmpl $0,%0\n"
	"\tbne 2b\n"
	"\trep ; nop\n"
	"\tjmpl 1b\n\n"
	"\t.section .previous\n"

or:

/* try atomic lock inline, if that fails, spin out of line */
"	btsl $1,%0
1:
	.section .text.lock

2:	cmpl $0,%0
	bne 2b
	jmpl 1b

	.section .previous"

or:
	while (unlikely(test_and_set_bit(1, lock))) {
		while (lock.value)
			arch_pause();
	}

Ooops, sorry, ignore 3 -- that's only possible in a world where there is 
intrinsic support in the compiler to generate the assembly we're aiming 
for.  But of the two assembly versions, I think the second is much more 
readable.  The few gcc people I've spoken to locally about this agreed with 
me when I showed them some of the inline assembly bits in the two forms as 
above.

		-ben

  reply	other threads:[~2001-10-22 20:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-22 20:05 [PATCH] gcc 3.0.1 warnings about multi-line literals John Hawkes
2001-10-22 20:15 ` Benjamin LaHaise
2001-10-22 20:45   ` Alan Cox
2001-10-22 20:51     ` Benjamin LaHaise [this message]
2001-10-22 21:39       ` David S. Miller
2001-10-23 12:04         ` David Howells
2001-10-25  7:11       ` Richard Henderson
2001-10-25 16:47         ` Benjamin LaHaise
2001-10-22 20:51   ` H. Peter Anvin

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=20011022165157.M23213@redhat.com \
    --to=bcrl@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hawkes@oss.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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