develooper Front page | perl.perl5.porters | Postings from June 2004

Re: [perl #29969] h2ph not correctly processing glibcsys/sysmacros.ph

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
June 10, 2004 07:10
Subject:
Re: [perl #29969] h2ph not correctly processing glibcsys/sysmacros.ph
Message ID:
20040610160717.44722bc4@localhost
Sam Vilain (via RT) wrote:
> h2ph sys/sysmacros.h incorrectly translates this:
> 
> #  define makedev(major, minor) { ((((unsigned int) (major)) << 8) \
>                                    | ((unsigned int) (minor))), 0 }
> 
> to this:
> 
>             eval "\n#line 10 sys/sysmacros.ph\n" . 'sub makedev {
>                 local($major, $minor) = @_;
>                 eval q({ (( << 8) | ( ($minor))), 0});
>             }' unless defined(&makedev);
> 
> This is a syntax error; it should read:
> 
>             eval "\n#line 10 sys/sysmacros.ph\n" . 'sub makedev {
>                 local($major, $minor) = @_;
>                 eval q({ (($major << 8) | ( ($minor))), 0});
>             }' unless defined(&makedev);

Wait, the story is not over; in recent glibcs (glibc-devel-2.3.3-12mdk)
sysmacros.h contains evil inline functions:

    __extension__ extern __inline unsigned int
    gnu_dev_major (unsigned long long int __dev) __THROW
    {
      return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
    }

and so on.

h2ph doesn't grok this. I think it should be patched...

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About