Disabling top level fixincludes

Bruce Korb bkorb@veritas.com
Tue Oct 12 21:27:00 GMT 2004


Hi guys,

C.F.: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg00934.html

Looks good to me.  My solution was just a no-op script when nothing
was wanted.  The main thing is to avoid doing a lot of work when
nothing needs doing.  :)  It looks like you've glued it into
a more general purpose construct.


C.F.: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01393.html

Fixing portability is a good thing.  I would try to reduce ifdef-ed
code though with things like:

  #ifndef SIGKILL
  #  define SIGKILL SIGTERM
  #endif

and then simply replace all:

  fcntl (stdout_pair.write_fd, F_DUPFD, STDOUT_FILENO);

type invocations with:

  dup2 (stdout_pair.write_fd, STDOUT_FILENO);

because the latter should always work.  Better still, macro-ize
the silly thing:

  #define DUP_FD( _ofd, _nfd ) \
    dup2 ( (_ofd), (_nfd) )

and if some platform needs the fcntl, another #define gets added
and the code remains unchanged.

Cheers - Bruce



More information about the Gcc-patches mailing list