From owner-freebsd-questions Thu May 31 7:13:58 2001 Delivered-To: freebsd-questions@freebsd.org Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id 2646837B42C for ; Thu, 31 May 2001 07:13:55 -0700 (PDT) (envelope-from jcm@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by probity.mcc.ac.uk with esmtp (Exim 2.05 #4) id 155TD0-000Lpj-00 for freebsd-questions@freebsd.org; Thu, 31 May 2001 15:13:54 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.1/8.11.1) id f4VEDru84819 for freebsd-questions@freebsd.org; Thu, 31 May 2001 15:13:53 +0100 (BST) (envelope-from jcm) Date: Thu, 31 May 2001 15:13:30 +0100 From: j mckitrick To: Don Dugger Subject: Re: what's wrong with this macro? Message-ID: <20010531151330.A84734@dogma.freebsd-uk.eu.org> References: <20010531143315.A83651@dogma.freebsd-uk.eu.org> <3B164FDD.B59D380A@hotlz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <3B164FDD.B59D380A@hotlz.com>; from dugger@hotlz.com on Thu, May 31, 2001 at 07:06:21AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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