Hi all,
As mentioned in the `EXIT STATUS' section of the ctags manual,
duplicate objects are not considered errors. Given that, I don't
think warnings about them should be printed by default, especially since
they can fill a whole terminal screen and aren't particularly useful,
at least to me.
Assuming people like this idea, perhaps the flag should be changed to
-W to avoid any confusion for users used to the current behavior.
Regards,
Michael
Index: ctags.1
===================================================================
RCS file: /cvs/src/usr.bin/ctags/ctags.1,v
retrieving revision 1.30
diff -u -p -r1.30 ctags.1
--- ctags.1 22 Aug 2015 06:46:00 -0000 1.30
+++ ctags.1 24 Aug 2015 20:19:37 -0000
@@ -105,7 +105,7 @@ $ ctags -v files | sort -f > index
$ vgrind -x index
.Ed
.It Fl w
-Suppress warning diagnostics.
+Print warning diagnostics.
.It Fl x
.Nm
produces a list of object
Index: ctags.c
===================================================================
RCS file: /cvs/src/usr.bin/ctags/ctags.c,v
retrieving revision 1.16
diff -u -p -r1.16 ctags.c
--- ctags.c 22 Aug 2015 04:23:07 -0000 1.16
+++ ctags.c 24 Aug 2015 20:19:37 -0000
@@ -56,7 +56,7 @@ long lineftell; /* ftell after getc( in
int lineno; /* line number of current line */
int dflag; /* -d: non-macro defines */
int vflag; /* -v: vgrind style index output */
-int wflag; /* -w: suppress warnings */
+int wflag; /* -w: print warnings */
int xflag; /* -x: cxref style output */
char *curfile; /* current input file name */
Index: ctags.h
===================================================================
RCS file: /cvs/src/usr.bin/ctags/ctags.h,v
retrieving revision 1.9
diff -u -p -r1.9 ctags.h
--- ctags.h 22 Aug 2015 04:23:07 -0000 1.9
+++ ctags.h 24 Aug 2015 20:19:37 -0000
@@ -67,7 +67,7 @@ extern long lineftell; /* ftell after g
extern int lineno; /* line number of current line */
extern int dflag; /* -d: non-macro defines */
extern int vflag; /* -v: vgrind style index output */
-extern int wflag; /* -w: suppress warnings */
+extern int wflag; /* -w: print warnings */
extern int xflag; /* -x: cxref style output */
extern bool _wht[], _itk[], _btk[];
extern char lbuf[LINE_MAX];
Index: tree.c
===================================================================
RCS file: /cvs/src/usr.bin/ctags/tree.c,v
retrieving revision 1.12
diff -u -p -r1.12 tree.c
--- tree.c 22 Aug 2015 04:23:07 -0000 1.12
+++ tree.c 24 Aug 2015 20:19:37 -0000
@@ -98,14 +98,14 @@ add_node(NODE *node, NODE *cur_node)
dif = strcmp(node->entry, cur_node->entry);
if (!dif) {
if (node->file == cur_node->file) {
- if (!wflag)
+ if (wflag)
fprintf(stderr, "Duplicate entry in file %s, "
"line %d: %s\nSecond entry ignored\n",
node->file, lineno, node->entry);
return;
}
if (!cur_node->been_warned)
- if (!wflag)
+ if (wflag)
fprintf(stderr, "Duplicate entry in files %s "
"and %s: %s (Warning only)\n",
node->file, cur_node->file, node->entry);