delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/05/09:41:09

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: __attribute__((packed)) on types
Date: Sun, 05 Jan 1997 08:24:38 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 29
Message-ID: <32CFD5C6.3139@cs.com>
References: <5amq4k$dvk AT news DOT luth DOT se>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp102.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Roland Nilsson wrote:
> 
> struct foo
> {
>         char a;
>         long b;
> } __attribute__((packed));
> 
> This will not compile - gcc thinks I forgot the ending ';', and it
> never recognizes the attribute. The error message:
> 
> foo.cc:5: semicolon missing after declaration of 'foo'

Attributes are fully implemented for every DJGPP version I have ever
seen.  The code fragment you wrote above, when pasted into a basic hello
world program, compiles without warnings with -Wall on my machine.  Are
you sure that's exactly how you wrote it in your code?

Also, what version of gcc are you using?  (Hint:  type 'gcc -v')

-- 
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>++ W++ N++ o+>++ K? w(---)
O- M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+(++) tv+() b+++ DI++ D++ G>++
e(*)>++++ h!() !r !y+()
------END GEEK CODE BLOCK------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019