public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Korn <dkorn@pixelpower.com>
To: "'Daniel.Andersson@combitechsystems.com'"
	<Daniel.Andersson@combitechsystems.com>,
	crossgcc@sourceware.cygnus.com
Cc: ecos-discuss@sources.redhat.com
Subject: [ECOS] RE: Macro problem with gcc and eCos
Date: Thu, 19 Apr 2001 10:30:00 -0000	[thread overview]
Message-ID: <718D38CAB6E0D011B2C90060970C28A564287F@exchangeserver.pixelpower.com> (raw)

>-----Original Message-----
>From: Daniel.Andersson@combitechsystems.com
>Sent: 19 April 2001 13:58

>The eCos code I got problem with looks like this:
>
>------snip--------
>#define CYG_MACRO_START do{
>#define CYG_MACRO_END   }while (0)
>
>#define CYG_EMPTY_STATEMENT CYG_MACRO_START CYG_MACRO_END
>
>#define CYG_UNUSED_PARAM( _type_, _name_ ) CYG_MACRO_START      \
>  _type_ __tmp1 = (_name_);                                     \
>  _type_ __tmp2 = __tmp1;                                       \
>  __tmp1 = __tmp2;                                              \
>CYG_MACRO_END
>-------end snip----


>It gives me the following error:
>
>------snip--------
>arm-elf-gcc -mcpu=arm7tdmi                       -c -o twothreads.o -g
>-Wall -I/ecos-work/include -ffunct
>ion-sections -fdata-sections  twothreads.c
>In file included from /ecos-work/include/cyg/kernel/kapi.h:53,
>                 from twothreads.c:1:
>/ecos-work/include/cyg/infra/cyg_type.h:169: parse error before `__tmp1'
>/ecos-work/include/cyg/infra/cyg_type.h:169: warning: type defaults to
>`int' in declaration of `__tmp1'
>/ecos-work/include/cyg/infra/cyg_type.h:169: `_name_' undeclared here (not
>in a function)
>/ecos-work/include/cyg/infra/cyg_type.h:169: warning: data definition has
>no type or storage class
>-------end snip----
>
>Does anyone know what the problem is?

  Nope.  But if you add the -E flag to your compile line, it will
probably become clear enough what's wrong with the source after the
preprocessor finished with it, that it will give you a clue what's
going wrong.

  The basic problem seems to be that Gcc hasn't spotted that those lines
are meant to be continuations.  Are there any blanks after the backslashes?
If so, then you don't have a macro continued over several lines; you have
separate lines, each one of which ends with an escaped space.

     DaveK
-- 
 All your base are belong to the Israeli army!  Oh, now they aren't again!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

                 reply	other threads:[~2001-04-19 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=718D38CAB6E0D011B2C90060970C28A564287F@exchangeserver.pixelpower.com \
    --to=dkorn@pixelpower.com \
    --cc=Daniel.Andersson@combitechsystems.com \
    --cc=crossgcc@sourceware.cygnus.com \
    --cc=ecos-discuss@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).