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:
Mark Jason Dominus
Date:
September 16, 2003 18:43
Subject:
Re: Interesting - [drow@mvista.com: A user's experiences with GCC-3.4 snapshots]
Message ID:
20030917014416.4754.qmail@plover.com
Chip Salzenberg <chip@pobox.com>:
> According to Mark-Jason Dominus:
> > I suggested (setproctitle!=main) because it seemed to me that there
> > was no way any compiler could possibly optimize away the comparision:
> 
> I agree.  OTOH, I don't think this works:
> 
> >         extern int main();
> >         int (*setproctitle)() = main;
> 

You are mistaken.  

> I don't believe that works; data pointers and function definitions
> don't work the same.  In fact, I don't believe there's any way in
> standard C to arrange for &func1 == &func2.

I didn't arange for &getproctitle == &main.  I arranged for
getproctitle == main, which was what I wrote on my original article.

Can I suggest that we stop this discussion?  It's no longer related to
Perl, and the recent contributions to the thread have been
superstitious and full of errors.  



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