develooper Front page | perl.perl5.porters | Postings from September 2003

Re: Interesting - [drow@mvista.com: A user's experiences with GCC-3.4 snapshots]

Thread Previous | Thread Next
From:
Graham Barr
Date:
September 17, 2003 00:15
Subject:
Re: Interesting - [drow@mvista.com: A user's experiences with GCC-3.4 snapshots]
Message ID:
B0620005-E8DE-11D7-8FA7-0003938857CC@pobox.com

On 17 Sep 2003, at 02:25, Chip Salzenberg wrote:
> So this should be portable:
>
>    typedef void VFUNC();
>    if ((VFUNC*)func != (VFUNC*)main) { ... }

Instead of trying to second guess what all optimizers will do, why not 
do something you *know* that they cannot do

int
main(int argc, char **argv) {
   if (argc == 9999) {
     extern void *setproctitle();
     setproctitle();
   }
   return 0;
}

Graham.


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