On Tue, Jul 29, 2014 at 9:46 PM, Mike Stump <mikest...@comcast.net> wrote:
> On Sep 12, 2013, at 1:47 AM, Richard Biener <rguent...@suse.de> wrote:
>> ! #if 0
>> !   FILE *file = fopen ("/tmp/rdg.dot", "w");
>> !   gcc_assert (file != NULL);
>> !
>>    dot_rdg_1 (file, rdg);
>> !   fclose (file);
>> !
>> !   system ("dotty /tmp/rdg.dot &");
>>  #else
>>    dot_rdg_1 (stderr, rdg);
>>  #endif
>> --- 276,290 ----
>>  DEBUG_FUNCTION void
>>  dot_rdg (struct graph *rdg)
>>  {
>> !   /* When debugging, you may want to enable the following code.  */
>> ! #if 1
>> !   FILE *file = popen("dot -Tx11", "w");
>> !   if (!file)
>> !     return;
>>    dot_rdg_1 (file, rdg);
>> !   fflush (file);
>> !   close (fileno (file));
>> !   pclose (file);
>>  #else
>>    dot_rdg_1 (stderr, rdg);
>>  #endif
>
> So I do compiler testing on my toaster oven by doing native builds of gcc 
> running on a binutils simulator and it doesn’t have a working popen (it’s in 
> my newlib, but it wants vfork, which I don’t have).  I do have fork and 
> system however.  :-) Could we replace the if 1 with if HAVE_popen where that 
> is done by an autoconf link test?

Sure - patches welcome.  You could also use _POSIX_C_SOURCE >= 2
|| _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE which I'm sure
your newlib provide anyway(?)

Richard.

Reply via email to