This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: strange error coming out of gcc
- To: "'sedat dot sengul at vestel-usa dot com'" <sedat dot sengul at vestel-usa dot com>, gcc-help at gcc dot gnu dot org
- Subject: RE: strange error coming out of gcc
- From: David Korn <dkorn at pixelpower dot com>
- Date: Tue, 13 Mar 2001 15:30:40 -0000
>-----Original Message-----
>From: Sedat Sengul [mailto:sedat.sengul@vestel-usa.com]
>Sent: 07 March 2001 23:30
>I am still trying to compile my ethernet driver :) (sorry about that I
>am trying to learn gcc behaviour) .
>But I have strange error coming out of gcc for header file.
>
>#define NIC_MASK_ALL_INTERRUPT(pAdapter) {
>
>NIC_COMMAND(pAdapter,COMMAND_SET_INTERRUPT_ENABLE |
>DISABLE_ALL_INTERRUPT);
>NIC_READ_PORT_USHORT(pAdapter, INTSTATUS_COMMAND_REGISTER);
>
>}
>
>and error is:
>
>3c90x.h:1300: parse error before '('
>
>line 1300 is:
>
>NIC_COMMAND macro
You can't split a macro definition across multiple lines, unless
you end each line with the '\' continuation character. So the compiler
sees
#define NIC_MASK_ALL_INTERRUPT(pAdapter) {
which is a not-very-useful definition of a macro that expands to one
curly brace, followed by
NIC_COMMAND(pAdapter,COMMAND_SET_INTERRUPT_ENABLE |
which looks like a statement, but we aren't in any function at the
moment. Have another go after you put '\' on all the lines of the
macro (except the last one; that doesn't need to be continued).
hth,
DaveK
--
All your base are belong to us!
**********************************************************************
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
**********************************************************************