This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
>> Index: gcc/fortran/error.c
>> ===================================================================
>> --- gcc/fortran/error.c (revision 199530)
>> +++ gcc/fortran/error.c (working copy)
>> @@ -30,6 +30,13 @@ along with GCC; see the file COPYING3. If not see
>> #include "flags.h"
>> #include "gfortran.h"
>>
>> +#if !(defined (_WIN32) || defined (VMS) || defined (__vxworks) || \
>> + defined (__Lynx__) || defined (__ANDROID__))
> We should better use autoconf rather than hard-coding platforms here.
Ok. Unfortunately I'm not much of a autoconf hero (better to say: not
at all). Is the new patch in the attachment sufficient (probably not
...)? I can not test it on my system with --enable-maintainer-mode
because I get:
configure.ac:2: error: Please use exactly Autoconf 2.64 instead of 2.69.
Why on earth does GCC require an old autoconf version?
>> +/* Determine terminal width (for trimming source lines in output). */
>> +
>> static int
>> get_terminal_width (void)
>> {
>> + /* Only limit the width if we're outputting to a terminal. */
>> + if (!isatty (STDERR_FILENO))
>> + return INT_MAX;
> Guard it with HAVE_UNISTD_H or HAVE_ISATTY ?
Done.
>> + /* Method #1: Use ioctl (not available on all systems). */
>> +#ifdef TIOCGWINSZ
>> + struct winsize w;
>> + ioctl (0, TIOCGWINSZ, &w);
> You should check the ioctl result. I bet it returns non-zero in
> Manfred's (pathological) case...
Also done.
> The rest looks good.
Thanks for the feedback, Mikael. New patch attached ...
Cheers,
Janus
Attachment:
terminal_width_v3.diff
Description: Binary data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |