delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2015/05/13/11:29:55

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=i3ZYGRdv+Hn5gt5YPuLqgZsYRoAqw7wppKydWDHA+58=;
b=NTKdA/84WAHRUyetis1CRZiCyDUsyb86cbrENJAA+KRVA075ZKWZrbzJyuF2lbf+jD
2CfnrRPNfiYYh8+znB9Qu+fZTkqI0Wf7+DgaHRdGN1UXZQbHPgN6EXBSVlb6t0yO4y61
EH5srjizUsIPvJjbERXEp64bR/eULxnk+qqLkePfCDEQSdzLEMfz07dz4djj8WhnXUDz
NWBdvZy3Yd3uLJdPk4WGznqz5Qlg8zY/ThfkfwKe6Cu0SJ4aQ/iN/uVXVKWfF3v1iHEz
G6uukFIKOr//BlHC73aWeCPQojzNvpDgJACi9cmrRd/UOJu8H4jFPDDLdX3hLjAXIL/j
8edg==
MIME-Version: 1.0
X-Received: by 10.50.225.35 with SMTP id rh3mr28724703igc.29.1431530979270;
Wed, 13 May 2015 08:29:39 -0700 (PDT)
Date: Wed, 13 May 2015 18:29:39 +0300
Message-ID: <CAA2C=vCgLHdH3BJxastGzUsJzhiRddytiYwB1MP_aaiiVpC4nA@mail.gmail.com>
Subject: bad pragma in dir.h? (and our structrure packing)
From: "Ozkan Sezer (sezeroz AT gmail DOT com)" <djgpp AT delorie DOT com>
To: djgpp <djgpp AT delorie DOT com>
Reply-To: djgpp AT delorie DOT com

In dir.h, structs ffblk and ffblklfn are surrounded by #pragma pack(1)
and #pragma pack(4), obviously with purpose of having those two structs
at byte packing.  But the restoration of the original packing by that
#pragma pack(4) seems wrong: do we not need a #pragma pack() in there,
or am I missing something?

While I was there, I also noticed that for structure packing in coff.h,
dir.h and dos.h we are marking every member with __attribute__((packed)
instead of giving the attribute to the stucture itself. What is the
reason for it?  I mean, dos.h:struct _find_t can be like the following
instead of what it currently is:
struct _find_t {
  char reserved[21];
  unsigned char attrib;
  unsigned short wr_time;
  unsigned short wr_date;
  unsigned long size;
  char name[256];
} __attribute__((packed));

--
O.S.

- Raw text -


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