Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!decwrl!mcnc!uvaarpa!mmdf From: marc@athena.mit.edu (Marc Horowitz) Newsgroups: comp.lang.perl Subject: why is this in h2ph Message-ID: <1991Jan8.073648.7186@uvaarpa.Virginia.EDU> Date: 8 Jan 91 07:36:48 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: marc@mit.edu Organization: The Internet Lines: 34 I don't think I've found another unintentional feature this time :-) In h2ph, there is this piece of code: elsif ($isatype{$id}) { $new .= "'$id'"; } What is it good for? The only time I've ever seen it match is when there is a cast in a #define. For example: #define lettera ((char) 65) becomes sub lettera {(('char') 65);} This causes perl to have fits, of course. Is there a reason that one of the matches in expr can't look like s/^\(((un)?signed\s+)?[_a-zA-Z]\w*\)//; If I understand h2ph correctly, this will have the useful effect of just stripping casts from #defines. Since perl doesn't do any kind of real types, if you're casting into something besides char, short, int, or long you're likely to lose anyway, so an error from the .ph file is probably appropriate. Basically, the intent is that casts, which are fairly common, not cause h2ph to lose. The subsidiary intent is that I not have to edit a lot of .ph files :-) Comments? Marc