Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.93k stars 552 forks source link

h2ph and unions #4191

Closed p5pRT closed 21 years ago

p5pRT commented 23 years ago

Migrated from rt.perl.org#7257 (status was 'resolved')

Searchable as RT7257$

p5pRT commented 23 years ago

From mickey@mail.lucifier.net

Created by mickey@lucifier.net

h2ph.PL mishandles the unions and causes wrong output produced for contructs like​: #define DVD_READ_STRUCT _IOWR('d'\, 0\, union dvd_struct)

this was originally reported in openbsd pr/1918 (see http​://cvs.openbsd.org/cgi-bin/wwwgnats.pl)

this diff seems to fix it​:

Index​: utils/h2ph.PL

RCS file​: /cvs/src/gnu/usr.bin/perl/utils/h2ph.PL\,v retrieving revision 1.9 diff -u -r1.9 h2ph.PL --- utils/h2ph.PL 2001/05/24 18​:36​:26 1.9 +++ utils/h2ph.PL 2001/07/10 17​:57​:14 @​@​ -351\,7 +351\,7 @​@​   # Eliminate typedefs   /\(([\w\s]+)[\*\s]*\)\s*[\w\(]/ && do {   foreach (split /\s+/\, $1) { # Make sure all the words are types\, - last unless ($isatype{$_} or $_ eq 'struct'); + last unless ($isatype{$_} or $_ eq 'struct' or $_ eq 'union');   }   s/\([\w\s]+[\*\s]*\)// && next; # then eliminate them.   }; @​@​ -374\,7 +374\,7 @​@​   };   s/^([_a-zA-Z]\w*)// && do {   my $id = $1; - if ($id eq 'struct') { + if ($id eq 'struct' || $id eq 'union') {   s/^\s+(\w+)//;   $id .= ' ' . $1;   $isatype{$id} = 1;

Perl Info ``` Flags: category=utilities severity=critical Site configuration information for perl v5.6.1: Configured by root at Tue Jul 10 13:58:29 EDT 2001. Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=openbsd, osvers=2.9, archname=i386-openbsd uname='openbsd' config_args='-Dopenbsd_distribution=defined -dsE' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include', optimize='-O2', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.95.3 20010125 (prerelease)', gccosandvers='openbsd2.9' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='' libpth=/usr/lib libs=-lm -lc -lutil perllibs=-lm -lc -lutil libc=/usr/lib/libc.so.27.0, so=so, useshrplib=true, libperl=libperl.so.6.1 Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=define, ccdlflags=' ' cccdlflags='-DPIC -fPIC ', lddlflags='-shared -fPIC ' Locally applied patches: @INC for perl v5.6.1: /usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 /usr/libdata/perl5 /usr/local/libdata/perl5 /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl . Environment for perl v5.6.1: HOME=/home/mickey LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/X11R6/lib:/usr/X11R6/xview/lib LOGDIR (unset) PATH=/home/mickey/bin/i386:/home/mickey/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/X11/xview/bin:/usr/bin/X11:/usr/games:/usr/hosts:/usr/cross/hppa/usr/bin:/usr/cross/tahoe/usr/bin PERL_BADLANG (unset) SHELL=/usr/local/bin/tcsh ```
p5pRT commented 21 years ago

From @jhi

This patch got into Perl 5.8.0\, I'm therefore marking the problem ticket as resolved.

p5pRT commented 21 years ago

@jhi - Status changed from 'open' to 'resolved'