All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Connectathon: Remove warning from general tests
@ 2011-01-27 18:49 Steve Dickson
  2011-01-27 18:49 ` [PATCH 1/3] Make the stat command ignore lines that it is not looking for Steve Dickson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steve Dickson @ 2011-01-27 18:49 UTC (permalink / raw)
  To: Linux NFS Mailing list

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(-)

-- 
1.7.3.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] Make the stat command ignore lines that it is not looking for.
  2011-01-27 18:49 [PATCH 0/3] Connectathon: Remove warning from general tests Steve Dickson
@ 2011-01-27 18:49 ` Steve Dickson
  2011-01-27 18:49 ` [PATCH 2/3] Make the tbl table smaller to avoid a warning about line width Steve Dickson
  2011-01-27 18:49 ` [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables Steve Dickson
  2 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2011-01-27 18:49 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 general/stat.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/general/stat.c b/general/stat.c
index c4e4fc0..2ce604e 100644
--- a/general/stat.c
+++ b/general/stat.c
@@ -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);
-- 
1.7.3.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] Make the tbl table smaller to avoid a warning about line width
  2011-01-27 18:49 [PATCH 0/3] Connectathon: Remove warning from general tests Steve Dickson
  2011-01-27 18:49 ` [PATCH 1/3] Make the stat command ignore lines that it is not looking for Steve Dickson
@ 2011-01-27 18:49 ` Steve Dickson
  2011-01-27 18:49 ` [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables Steve Dickson
  2 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2011-01-27 18:49 UTC (permalink / raw)
  To: Linux NFS Mailing list

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 general/nroff.in |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/general/nroff.in b/general/nroff.in
index 522ac80..5722733 100644
--- a/general/nroff.in
+++ b/general/nroff.in
@@ -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
-- 
1.7.3.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables
  2011-01-27 18:49 [PATCH 0/3] Connectathon: Remove warning from general tests Steve Dickson
  2011-01-27 18:49 ` [PATCH 1/3] Make the stat command ignore lines that it is not looking for Steve Dickson
  2011-01-27 18:49 ` [PATCH 2/3] Make the tbl table smaller to avoid a warning about line width Steve Dickson
@ 2011-01-27 18:49 ` Steve Dickson
  2011-01-28  2:11   ` Jeff Layton
  2 siblings, 1 reply; 5+ messages in thread
From: Steve Dickson @ 2011-01-27 18:49 UTC (permalink / raw)
  To: Linux NFS Mailing list

From: Jeff Layton <jlayton@redhat.com>

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.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 general/nroff.in |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/general/nroff.in b/general/nroff.in
index 5722733..ff57200 100644
--- a/general/nroff.in
+++ b/general/nroff.in
@@ -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
-- 
1.7.3.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables
  2011-01-27 18:49 ` [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables Steve Dickson
@ 2011-01-28  2:11   ` Jeff Layton
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2011-01-28  2:11 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing list

On Thu, 27 Jan 2011 13:49:34 -0500
Steve Dickson <steved@redhat.com> wrote:

> From: Jeff Layton <jlayton@redhat.com>
> 
> 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.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  general/nroff.in |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/general/nroff.in b/general/nroff.in
> index 5722733..ff57200 100644
> --- a/general/nroff.in
> +++ b/general/nroff.in
> @@ -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

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.

-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-28  2:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 18:49 [PATCH 0/3] Connectathon: Remove warning from general tests Steve Dickson
2011-01-27 18:49 ` [PATCH 1/3] Make the stat command ignore lines that it is not looking for Steve Dickson
2011-01-27 18:49 ` [PATCH 2/3] Make the tbl table smaller to avoid a warning about line width Steve Dickson
2011-01-27 18:49 ` [PATCH 3/3] cthon04: add "nowarn" option to nroff.in tables Steve Dickson
2011-01-28  2:11   ` Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.