Subject: __attribute__ ((packed)) and enums not working
From: Bruce Edge <[email-masked]>
To: cygwin support <[email-masked]>
Date: Tue, 28 Nov 2000 14:27:42 -0800

Earnie Boyd wrote:
> 
> --- Bruce Edge <[email-masked]> wrote:
> > Earnie Boyd wrote:
> > >
> > > --- Bruce Edge <[email-masked]> wrote:
> > > > The packed attribute mechanism seems to work for structs, but not enums:
> > > >
> > > > struct x {   char c;     int i;  } __attribute__ ((packed));
> > > > enum p { red, green, yellow } __attribute__ ((packed));
> > > >
> > > > pcl_op.h:144: semicolon missing after declaration of `p'
> > > >
> > > > Has anyone used this successfully?
> > > >
> > >
> > > I don't have a problem with this.  Perhaps your pcl_op.h file has \r\n line
> > > endings and you have binary mounts.
> >
> > It _is_ a DOS file, but if that were the case I think I would be seeing many
> > other errors.
> >
> > I did get it working, but I had to use the gcc option -fshort_enums, rather
> > than the explicit type attribute modifier.
> >
> > Is there a gcc bug in handling the __attribute__((packed)) when used in
> > conjunction with an enum declaration?
> >
> 
> You'll need to provide the output of `cygcheck -s -r -v' pasted in a mail to
> the list and not to me.  Also, the contents of /etc/setup/installed.db would be
> appreciated.

Sorry, I keep hitting "reply". For some reason the cygwin list mail I get is
from the poster, and not from the [email-masked]

> 
> As I said earlier, pasting your example into foo.c and gcc -c foo.c produced no
> errors.

Try pasting it into foo.cc, that causes it to fail.

Here's my cygcheck output
----------------------------------

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Wed Nov 29 14:23:42 2000

WinNT Ver 4.0 build 1381 Service Pack 4

Path:   /usr/local/bin
        /usr/bin
        /bin
        /cygdrive/d/WINNT/system32
        /cygdrive/d/WINNT
        /cygdrive/d/Program Files/Perforce
        /cygdrive/d/PROGRA~1/Tcl/bin
        /cygdrive/c/DOS

SysDir: D:\WINNT\System32
WinDir: D:\WINNT

PWD = `/home/bedge/tmp'
USER = `bedge'
MAKE_MODE = `unix'
HOME = `/home/bedge'

NUMBER_OF_PROCESSORS = `1'
PROMPT = `$P$G'
LOGONSERVER = `\\LOUIE'
OS2LIBPATH = `D:\WINNT\system32\os2\dll;'
P4PORT = `192.168.1.252:1666'
COMSPEC = `D:\WINNT\system32\cmd.exe'
SYSTEMDRIVE = `D:'
DARTS_GENERATED = `/home/bedge/p4/ncc/524/main/qnx/generated/usr/darts'
HOSTNAME = `LOUIE'
PROCESSOR_REVISION = `0502'
!D: = `D:\cygwin\bin'
PATHEXT = `.COM;.EXE;.BAT;.CMD'
COMPUTERNAME = `LOUIE'
CLASSPATH = `;'
WINDIR = `D:\WINNT'
USERPROFILE = `D:\WINNT\Profiles\Administrator'
P4CLIENT = `louie_nt.bedge.darts.524'
PS1 = `\[\033]0;\w\007\033[32m\]\u@\h \[\033[33m\w\033[0m\]
$ '
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 5 Stepping 2, GenuineIntel'
OS = `Windows_NT'
DARTS_LITERAL = `/home/bedge/p4/ncc/524/main/qnx/literal/usr/darts'
OLDPWD = `/home/bedge'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/cygdrive/d/TEMP'
DARTS = `/home/bedge/p4/ncc/524/main/qnx/source/usr/darts'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `D:\WINNT'
HOMEDRIVE = `D:'
SHLVL = `1'
HOMEPATH = `\'
USERDOMAIN = `LOUIE'
USERNAME = `bedge'
SHELL = `/bin/sh'
HOSTTYPE = `i686'
OSTYPE = `cygwin'
TERM = `cygwin'
_ = `/usr/bin/cygcheck'
TZ = `PST8PDT7,M4.1.0/2,M10.5.0/2'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\S
tart Menu\&Programs\Cygnus Solutions
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\S
tart Menu\&Programs\Cygnus Solutions\Menu
  (default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `D:/cygwin'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `D:/cygwin/bin'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `D:/cygwin/lib'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A
c:  hd  FAT      516Mb  99% CP    UN           MS-DOS_6
d:  hd  NTFS    1299Mb  92% CP CS UN PA FC
e:  cd           N/A    N/A
i:  net NTFS   26027Mb  33% CP CS UN PA FC     DATA
j:  net NTFS   26027Mb  33% CP CS UN PA FC     DATA

D:\cygwin\bin  /usr/bin  system  textmode
D:\cygwin\lib  /usr/lib  system  textmode
D:\cygwin  /        system  textmode

Found: D:\cygwin\bin\bash.exe
Found: D:\cygwin\bin\cat.exe
Found: D:\cygwin\bin\cpp.exe
Found: D:\cygwin\bin\find.exe
Found: c:\DOS\find.exe
Warning: D:\cygwin\bin\find.exe hides c:\DOS\find.exe
Found: D:\cygwin\bin\gcc.exe
Found: D:\cygwin\bin\ls.exe
Found: D:\cygwin\bin\make.exe
Found: D:\cygwin\bin\sh.exe
 
   83k 2000/11/25 D:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2000/11/24 21:42
   18k 2000/10/23 D:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2000/10/22 19:26
   14k 2000/10/23 D:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2000/10/23 12:02
   83k 2000/06/11 D:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2000/6/10 20:34
   35k 2000/06/11 D:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2000/6/10 20:34
   45k 2000/10/22 D:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                  "cygjbig1.dll" v0.0 ts=2000/10/22 16:06
  119k 2000/10/23 D:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                  "cygjpeg6b.dll" v0.0 ts=2000/10/22 17:58
   53k 2000/11/25 D:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2000/11/24 21:42
  300k 2000/11/25 D:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2000/11/24 21:40
   35k 2000/11/25 D:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2000/11/24 21:41
  162k 2000/10/23 D:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                  "cygpng2.dll" v0.0 ts=2000/10/22 17:40
  402k 2000/06/11 D:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2000/6/10 20:30
    5k 2000/06/11 D:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2000/06/11 D:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2000/6/10 20:30
  243k 2000/10/23 D:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                  "cygtiff3.dll" v0.0 ts=2000/10/22 18:14
  639k 2000/06/11 D:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2000/6/10 20:34
   41k 2000/11/20 D:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-noX4.dll" v0.0 ts=2000/11/19 18:41
   45k 2000/11/20 D:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-X4.dll" v0.0 ts=2000/11/19 18:45
   49k 2000/10/23 D:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2000/10/22 17:22
  609k 2000/11/22 D:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2000/11/21 18:00
    Cygwin DLL version info:
        dll major: 1001
        dll minor: 6
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 30
        shared data: 3
        dll identifier: cygwin1
        mount registry: 2
        cygnus registry name: Cygnus Solutions
        cygwin registry name: Cygwin
        program options name: Program Options
        cygwin mount registry name: mounts v2
        cygdrive flags: cygdrive flags
        cygdrive prefix: cygdrive prefix
        cygdrive default prefix:
        build date: Tue Nov 21 21:00:16 EST 2000
        shared id: cygwin1S3
 
Use -h to see help about each
section                                           
----------------------------------

and my intalled.db:

----------------------------------
byacc latest/byacc/byacc.tar.gz 30927
bzip2 latest/bzip2/bzip2.tar.gz 80249
clear latest/clear/clear-1.0.tar.gz 925
crypt latest/crypt/crypt-1.0.tar.gz 7407
dejagnu latest/dejagnu/dejagnu.tar.gz 137959
diff latest/diff/diff.tar.gz 94144
expect latest/expect/expect.tar.gz 160259
fileutils latest/fileutils/fileutils.tar.gz 260213
findutils latest/findutils/findutils.tar.gz 81300
flex latest/flex/flex.tar.gz 129032
gawk latest/gawk/gawk-3.0.4.tar.gz 326380
gdb latest/gdb/gdb-20000610.tar.gz 3253851
gperf latest/gperf/gperf.tar.gz 47317
grep latest/grep/grep.tar.gz 128196
groff latest/groff/groff-1.11a-1.tar.gz 1986071
gzip latest/gzip/gzip.tar.gz 91515
login latest/login/login-1.4-1.tar.gz 8756
m4 latest/m4/m4.tar.gz 68815
man latest/man/man-1.5g-2.tar.gz 50382
mt latest/mt/mt-1.9.1.tar.gz 10063
openssl latest/openssl/openssl-0.9.5a.tar.gz 3852643
patch latest/patch/patch.tar.gz 39608
sed latest/sed/sed-3.02-1.tar.gz 33953
shellutils latest/shellutils/shellutils.tar.gz 272743
tcltk latest/tcltk/tcltk-20000610.tar.gz 1811933
textutils latest/textutils/textutils-2.0-1.tar.gz 579785
time latest/time/time.tar.gz 11137
vim latest/vim/vim-5.7-4.tar.gz 1477095
ash latest/ash/ash-20001012.tar.gz 34788
termcap latest/termcap/termcap-20001020-1.tar.gz 18699
make latest/make/make-3.79.1-2.tar.gz 288557
bison latest/bison/bison-1.28-1.tar.gz 123218
cvs contrib/cvs/cvs-1.11.0-1.tar.gz 886467
gdbm contrib/gdbm/gdbm-1.8.0-3.tar.gz 49710
jbigkit contrib/jbigkit/jbigkit-1.2-3.tar.gz 83876
jpeg contrib/jpeg/jpeg-6b-3.tar.gz 300495
less latest/less/less-358-2.tar.gz 66678
libpng contrib/libpng/libpng-1.0.8-2.tar.gz 266528
regex latest/regex/regex-4.4.tar.gz 29048
tar latest/tar/tar-1.13-2.tar.gz 401200
tiff contrib/tiff/tiff-3.5.5-3.tar.gz 488508
zlib contrib/zlib/zlib-1.1.3-5.tar.gz 72671
inetutils latest/inetutils/inetutils-1.3.2-8.tar.gz 248312
autoconf latest/autoconf/autoconf-2.13.tar.gz 261770
gcc latest/gcc/gcc-2.95.2-5.tar.gz 5718172
mingw latest/mingw/mingw-20001111-1.tar.gz 130113
w32api latest/w32api/w32api-20001111-1.tar.gz 595938
bash latest/bash/bash-2.04-4.tar.gz 274112
binutils latest/binutils/binutils-20001029-2.tar.gz 3418504
newlib-man latest/cygwin/newlib-man-20001118.tar.gz 64618
openssh latest/openssh/openssh-2.3.0p1-1.tar.gz 1196066
gettext contrib/gettext/gettext-0.10.35-2p1.tar.gz 346343
ncurses contrib/ncurses/ncurses-5.2-2.tar.gz 2307402
opengl latest/opengl/opengl-1.1.0-3.tar.gz 878290
texinfo latest/texinfo/texinfo-4.0-2.tar.gz 794018
xpm contrib/xpm/xpm-4.0.0-2.tar.gz 421955
cygwin latest/cygwin/cygwin-1.1.6-1.tar.gz
652789                               
----------------------------------

-Bruce.

--
Want to unsubscribe from this list?
Send a message to [email-masked]