🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fido.belg.linux
Article #101

GCC

#101
From: Erik Cumps
Date: Mon, 24 Jan 2000 00:00
54 lines
2157 bytes
Hello David,

On 22 Jan 00, David De Grave scribbled this to Erik Cumps:

 EC>> Use 'info gcc' for more info. Look at node "Variable Attributes"...

 DDG> Okay... I've find the specified documentation. But that seems to not
 DDG> working correctly...

Hmmm...

 DDG> Look : Like as the documentation, I've written this :

 DDG> struct  USERSrecord { [...] };

 DDG> void    putallusers()
 DDG> {
 DDG>     struct USERSrecord bu __attribute__ ((packed));

 DDG>     [...]
 DDG> }

You need to use the __atribute__ keyword when you declare your structure, not
when you're declaring a variable whose type is that struct. A struct is either
packed, or it is not.

In other words, do it this way:

struct USERSrecord { ... } __attribute__ ((packed));

void putallusers (void)
{
    struct USERSrecord bu;

    ...
}

 DDG> but at compilation, I've the following message :

 DDG> ubrows.c: In function `putallusers':
 DDG> ubrows.c:34: warning: `packed' attribute ignored

Indeed. This is quite normal.

 DDG> And this macro doesn't work on DOS machine with a TC compiler ;-( (fixed
 DDG> with a #ifdef _DOS ;-))

Of course! It is, after all, a GCC extension. :)

Cya, Erik

Picked up this message, floating thru space:

... I live in a quiet neighborhood - We use silencers.
Technical Details
Message-ID: <948686300@f629.n292.z2.ftn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <948559850@f739.n292.z2.ftn>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c329,2f0a3098512417f9,start
X-Google-Attributes: gid10c329,public
From: Erik Cumps <Erik.Cumps@f629.n292.z2.fidonet.org>
Subject: GCC
Date: 2000/01/24
Message-ID: <948686300@f629.n292.z2.ftn>
X-Deja-AN: 578111432
Distribution: fido7
Content-Transfer-Encoding: 8bit
X-FTN-Origin: Whip me. Beat me. Make me use NT. (2:292/629)
References: <948559850@f739.n292.z2.ftn>
X-FTN-REPLY: 2:292/739 3889dfea
X-FTN-PATH: 292/629 624 907 854 862
X-Comment-To: David De Grave
Content-Type: text/plain; charset=iso-8859-1
X-FTN-CHRS: LATIN-1 2
X-FTN-SEEN-BY: 292/8010 8215
X-FTN-Tearline: GoldED/LNX 3.0.1 (homebrew)
X-FTN-MSGID: 2:292/629 388bcddc
X-FTN-AREA: LINUX.B
Organization: Whip me. Beat me. Make me use NT.
Mime-Version: 1.0
Newsgroups: fido.belg.linux