public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* __asm__ and
@ 2001-09-21 10:34 Shaun Jackman
  2001-09-28 17:19 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Shaun Jackman @ 2001-09-21 10:34 UTC (permalink / raw)
  To: gcc-help

Can someone tell me what I'm doing wrong here? When I use this macro, like
void myfunc( void) {
	int_disable();
	// do stuff
	int_enable();
}

#define int_disable() \
    __asm__( \
            "mrs %0, cpsr \n\t" \
            "orr %0, %0, #I_BIT \n\t" \
            "msr cpsr, %0 \n\t" \
            : "=r" : : "cpsr" \
           )

I get the error
cs8900.c:246: parse error before ':' token

This is confusing me. I followed the examples in the info page and I can't 
figure it out.

Thanks,
Shaun

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: __asm__ and
  2001-09-21 10:34 __asm__ and Shaun Jackman
@ 2001-09-28 17:19 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2001-09-28 17:19 UTC (permalink / raw)
  To: Shaun Jackman; +Cc: gcc-help

On Sep 21, 2001, Shaun Jackman <sjackman@pathwayconnect.com> wrote:

> #define int_disable() \
>     __asm__( \
>             "mrs %0, cpsr \n\t" \
>             "orr %0, %0, #I_BIT \n\t" \
>             "msr cpsr, %0 \n\t" \
>             : "=r" : : "cpsr" \
>            )

> I get the error
> cs8900.c:246: parse error before ':' token

This looks very much like the typical CR+LF (*) error.  GCC used to
fail when processing files that were not uniform in using CR+LF or
just LF for line breaks.  When finding a CR, it would sometimes
interpret that as whitespace after `\', and not merge the lines
together, resulting in this kind of error.  Please make sure this file
doesn't contain embedded CRs and try again.

* CR stands for Carriage Return, or ^M, ASCII 13, whereas LF stands
  for Line Feed, ^J, ASCII 10.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-28 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-21 10:34 __asm__ and Shaun Jackman
2001-09-28 17:19 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).