Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 May 2001 15:13:30 +0100
From:      j mckitrick <jcm@FreeBSD-uk.eu.org>
To:        Don Dugger <dugger@hotlz.com>
Subject:   Re: what's wrong with this macro?
Message-ID:  <20010531151330.A84734@dogma.freebsd-uk.eu.org>
In-Reply-To: <3B164FDD.B59D380A@hotlz.com>; from dugger@hotlz.com on Thu, May 31, 2001 at 07:06:21AM -0700
References:  <20010531143315.A83651@dogma.freebsd-uk.eu.org> <3B164FDD.B59D380A@hotlz.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 31, 2001 at 07:06:21AM -0700, Don Dugger wrote:
| Can you show us the error the compiler is giving you and is it erroring
| on the #define or the expansion?

dogma:~> cc grr.c
grr.c:3: `source' undeclared here (not in a function)
grr.c:3: warning: data definition has no type or storage class
grr.c:3: stray '\' in program
grr.c:4: conflicting types for `target'
grr.c:3: previous declaration of `target'
grr.c:4: `source' undeclared here (not in a function)
grr.c:4: warning: data definition has no type or storage class
grr.c:4: stray '\' in program
grr.c:5: conflicting types for `target'
grr.c:4: previous declaration of `target'
grr.c:5: `source' undeclared here (not in a function)
grr.c:5: warning: data definition has no type or storage class
grr.c:5: stray '\' in program
grr.c:6: conflicting types for `target'
grr.c:5: previous declaration of `target'
grr.c:6: `source' undeclared here (not in a function)
grr.c:6: warning: data definition has no type or storage class
grr.c:6: stray '\' in program
grr.c:7: syntax error before `}'
dogma:~>

I cut and pasted the macro into a new file to isolate the problem.  Here is
the entire file, no expansion or anything else:

dogma:~> cat grr.c
#define COPY_BLOCK(target, source) { \
        (target)[0] = (source)[0]; \
        (target)[1] = (source)[1]; \
        (target)[2] = (source)[2]; \
        (target)[3] = (source)[3]; \
} /*  COPY_BLOCK */



jcm
-- 
"I drank WHAT ?!" - Socrates

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010531151330.A84734>