This is the mail archive of the gcc-patches@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: [PATCH] On bulletproofing -fsyntax-only



  In message <jmhfbiv5w0.fsf@envy.cygnus.com>you write:
  > > I think that the method currently being used to suppress output within
  > > gcc (preventing asm_out_file from being written to when syntax_only is
  > > on if it looks like that code path will be walked down) is fragile,
  > > because unless *every* use of asm_out_file is armoured that way, we'll
  > > eventually end up trying to write to it again. And armouring every use
  > > is tricky and ugly, because ports manipulate asm_out_file, and because
  > > not every use of asm_out_file is via the ASM_*() macros.
  > 
  > I agree...
Likewise.


  > > I propose bulletproofing the existing code by making asm_out_file point
  > > to /dev/null (or a comparable bitbucket) when syntax_only is on. With
  > > that in place, we'll waste nothing but a little time if we accidentally
  > > try to stick stuff into the asm_out_file, rather than crashing.
  > 
  > This sounds like a reasonable idea.
We can't assume anything about /dev/null.  Consider windows, vms and other
non-unixy systems.  Ahh, y'all seem to have thought of it below.  Excellent.


  > > I foresee only two potential problems with this approach: different OSes
  > > have different bit buckets (some might not have them at all), and you
  > > can't normally seek in a bit bucket.
  > 
  > On systems that really don't have a bit bucket, you could write to a
  > temporary file, and just delete it when done.
That would be fine by me.  Presumably we'd write an autoconf test to see
if we've got a bit bucket.

  > > Here's a patch which squashes this problem using the method above
  > > (without the /dev/null autoconf test, as yet). If needed I can mail off
  > > a copyright assignment form (although, especially without the autoconf
  > > part, this fix is probably too small to merit it). I've also got a patch
  > > against 2.95.2, because my original problem was there ;)
  > 
  > Please do send in a form.
Agreed.
jeff


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