This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc/pself*


Joern Rennecke wrote:
> 
> > With the passing of time, these kinds of things can become harder
> > and harder to find - for instance, the hangman pragma has been gone
> > for so long that it's now passed into legend.  It would be good to
> 
> hangman?  Where did hangman come in?

The "try different programs" code came later, although I don't
ever remember a version that didn't try "hangman" or "hm" first,
then the other programs.  It's too bad we don't have a full change
history for GCC to answer this and the more important questions
that come up from time to time...

Stan

> /* This was a fun hack, but #pragma seems to start to be useful.
>    By failing to recognize it, we pass it through unchanged to cc1.  */
> 
> /*
>  * the behavior of the #pragma directive is implementation defined.
>  * this implementation defines it as follows.
>  */
> 
> static int
> do_pragma ()
> {
>   close (0);
>   if (open ("/dev/tty", O_RDONLY, 0666) != 0)
>     goto nope;
>   close (1);
>   if (open ("/dev/tty", O_WRONLY, 0666) != 1)
>     goto nope;
>   execl ("/usr/games/hack", "#pragma", 0);
>   execl ("/usr/games/rogue", "#pragma", 0);
>   execl ("/usr/new/emacs", "-f", "hanoi", "9", "-kill", 0);
>   execl ("/usr/local/emacs", "-f", "hanoi", "9", "-kill", 0);
> nope:
>   fatal ("You are in a maze of twisty compiler features, all different");
> }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]