Connectathon: Remove warning from general tests
Subsystems (2)
cover Connectathon: Remove warning from general tests
Here are three approaches to removing the
warning: around line 47: table wider than line width
that is currently occurring in the general tests.
The first approach is to make the stat command, which read the output time file, ignore lines it does not understand.
The second approach was to fix the nroff.in file. It turns out, the only I could stop that warning was to decrease the width of the table. Through my trials and tribulations with this, I'm beginning to believe the generating of this warning is a bug in the groff command, since I can not find anything wrong with the original table definition.
The third and final approach is a patch that Jeff Layton purposed that leaves the table width alone and adds the "nowarn" to the global options of the table.
All three seem to do the trick but obviously we don't need all three... I am leaning towards the first approach since its not dependent on nroff/tbl isms...
Steve Dickson (2):
Make the stat command ignore lines that it is not looking for. Make the tbl table smaller to avoid a warning about line width
Jeff Layton (1):
cthon04: add "nowarn" option to nroff.in tables
general/nroff.in | 2 +- general/stat.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.3.3
PATCH 1/3 Make the stat command ignore lines that it is not looking for.
--- general/stat.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
general/stat.c +7 -2
@@ -30,7 +30,7 @@ main(argc, argv) {FILE *fp;int i, n; -char c, *fmt; +char c, *fmt, buf[BUFSIZ ];int attfmt =0 ;/* set if using att time format */ Prog = argv[0 ];
@@ -45,6 +45,7 @@ main(argc, argv) Prog, File);exit (1 ); } +getnewch:if ((i =fgetc (fp)) ==EOF ) {fprintf (stderr,"%s: %s is empty\n" , Prog, File);
@@ -53,8 +54,12 @@ main(argc, argv) c = i &0x7f ;if (c =='\n' || c =='\r' || c =='r' ) attfmt =1 ; -else +else if (isdigit (c)) fmt ="%lf %*s %lf %*s %lf %*s" ;/* BSD fmt */ +else {/* skip the line */ +fgets (buf,BUFSIZ , fp); + goto getnewch; + }if (ungetc (c, fp) ==EOF ) {fprintf (stderr,"%s: can't push char back to %s\n" , Prog, File);
Signature · 1 line
1.7.3.3
PATCH 2/3 Make the tbl table smaller to avoid a warning about line width
In reply to Steve Dickson--- general/nroff.in | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
general/nroff.in +5 -5
@@ -39,11 +39,11 @@ A prime number generator. .LP .TS center; - c|c|c s|c s| - c|c|c s|c s| - c|c|c s|c s| - c|c|c s|c s| -|l|n|n|n|n|n|. + c|c|c s| + c|c|c s| + c|c|c s| + c|c|c s| +|l|n|n|n|. _ _ _ _ _ .sp 4p Matrix Inversion Bubble Sort Prime Numbers
Signature · 1 line
1.7.3.3
PATCH 3/3 cthon04: add "nowarn" option to nroff.in tables
In reply to Steve DicksonFrom: Jeff Layton <[email protected]>
This prevents the tbl preprocessor from stuffing warnings into the resulting file, which subsequently can make nroff spew warnings like this on stderr:
warning: file `nroff.in', around line 47:
table wider than line width
Unfortunately, I'm not sure how non-gnu tbl programs will react to this option, so YMMV.
--- general/nroff.in | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
general/nroff.in +6 -6
@@ -38,12 +38,12 @@ A bubble sort of integers. A prime number generator. .LP .TS -center; - c|c|c s| - c|c|c s| - c|c|c s| - c|c|c s| -|l|n|n|n|. +center nowarn; + c|c|c s|c s| + c|c|c s|c s| + c|c|c s|c s| + c|c|c s|c s| +|l|n|n|n|n|n|. _ _ _ _ _ .sp 4p Matrix Inversion Bubble Sort Prime Numbers
Signature · 1 line
1.7.3.3
Re: [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables
Quoted 30 lines · On Thu, 27 Jan 2011 13:49:34 -0500 Steve Dickson <[email protected]> wrote:
From: Jeff Layton <[email protected]>
This prevents the tbl preprocessor from stuffing warnings into the resulting file, which subsequently can make nroff spew warnings like this on stderr:
warning: file `nroff.in', around line 47:
table wider than line widthUnfortunately, I'm not sure how non-gnu tbl programs will react to this option, so YMMV.
Signed-off-by Jeff Layton <[email protected]>Signed-off-by Steve Dickson <[email protected]>--- general/nroff.in | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)general/nroff.in +0
-5@@ -38,12 +38,12 @@ A bubble sort of integers. A prime number generator. .LP .TS -center; - c|c|c s| - c|c|c s| - c|c|c s| - c|c|c s|
general/nroff.in A bubble sort of integers. · line 49
Quoted 10 lines
general/nroff.in +6
-1-|l|n|n|n|. +center nowarn; + c|c|c s|c s| + c|c|c s|c s| + c|c|c s|c s| + c|c|c s|c s| +|l|n|n|n|n|n|. _ _ _ _ _ .sp 4p Matrix Inversion Bubble Sort Prime Numbers
It looks like this patch reverts the change in patch 2?
If patch 2 prevents the warning and the stat.c now skips lines that it's not looking for, it might be better to just drop this patch since "nowarn" might cause non-gnu tbl programs to fail.
Signature · 1 line
Jeff Layton <[email protected]>