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

Re: Interesting - [ A user's experiences with GCC-3.4 snapshots]

Thread Previous | Thread Next
Mark Jason Dominus
September 16, 2003 18:43
Re: Interesting - [ A user's experiences with GCC-3.4 snapshots]
Message ID:
Chip Salzenberg <>:
> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About