From c682fc753920099a11eaf6f9675352ee2d480e74 Mon Sep 17 00:00:00 2001 From: Robert Morin Date: Mon, 8 Jul 2024 14:50:50 -0400 Subject: [PATCH 1/2] No documentation or help for 'uno_suppress' file. Minor fix: - One extra test removed. --- Doc/uno.1 | 6 +++++- Src/uno.c | 9 ++++++--- Src/uno_lts.c | 18 ++++++++++-------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Doc/uno.1 b/Doc/uno.1 index 740d660..9f5c6be 100644 --- a/Doc/uno.1 +++ b/Doc/uno.1 @@ -34,6 +34,10 @@ as a whole. The local check applies to the use of local variables of any type, the global check applies to the use of global pointers only. .PP +\*U can suppress warnings on lines by adding filename and +line number, separated by a tab, in uno_suppress file. +This does not suppress reports generated by uno_global in global analyses. +.PP The first group of options allows for the definition of compiler directives on the command line, to guide the preprocessing of the sources. @@ -59,7 +63,7 @@ for include files. .B "-Uname" Remove any definitions of name, where name is a reserved symbol that may be predefined by the preprocessor. -If present, this action supersedes the possible use of +If present, this action supersedes the possible use of .B "-D" for the same symbol, irrespective of the order in which these options are given. diff --git a/Src/uno.c b/Src/uno.c index fd7d961..54b02e1 100644 --- a/Src/uno.c +++ b/Src/uno.c @@ -61,9 +61,10 @@ uno_usage(void) fprintf(stderr, "\t-Lname replace uno_local with name\n"); fprintf(stderr, "\t-Gname replace uno_global with name\n"); fprintf(stderr, "\t-n ignore preprocessing directives in source files\n"); - fprintf(stderr, "\t-o arg ignored, for modest compatability with cc arguments\n"); + fprintf(stderr, "\t-o arg ignored, for modest compatibility with cc arguments\n"); fprintf(stderr, "\t-m uno.dfn use master (type) definitions file uno.dfn\n"); - fprintf(stderr, "\t-x f declare f to be a function that does not return\n\n"); + fprintf(stderr, "\t-x f declare f to be a function that does not return.\n" + "\t\t\tOptional: Add :n where n is the number of parameters.\n"); fprintf(stderr, "\t-V print version number and exit\n"); fprintf(stderr, "\t-s print symbol table information and exit\n\n"); fprintf(stderr, "\t-l or -c perform only local analysis, not global\n"); @@ -76,7 +77,9 @@ uno_usage(void) fprintf(stderr, "\t-t more detailed execution traces (global analysis)\n"); fprintf(stderr, "\t-u complain about redundancies of all sorts\n"); fprintf(stderr, "\t-v verbose mode (mostly for debugging)\n"); - fprintf(stderr, "\t-w more picky, includes -u and -t\n"); + fprintf(stderr, "\t-w more picky, includes -u and -t\n\n"); + fprintf(stderr, "\tWarning can be suppressed by adding the filename and line" + " number, separated by a tab, in uno_suppress file.\n" ); exit(1); } diff --git a/Src/uno_lts.c b/Src/uno_lts.c index 1458181..91d8c13 100644 --- a/Src/uno_lts.c +++ b/Src/uno_lts.c @@ -663,20 +663,22 @@ custom_exit(const char *s) { EX *nx; char *col; + nx = (EX *) emalloc(sizeof(EX)); + nx->f = (char *) emalloc(strlen(s)+1); + strcpy(nx->f, s); + col = strchr(s, ':'); if (col) { *col = '\0'; col++; + nx->has_arg = 1; + nx->arg_val = atoi(col); + } + else + { nx->has_arg = 0; + nx->arg_val = 0; } - nx = (EX *) emalloc(sizeof(EX)); - nx->f = (char *) emalloc(strlen(s)+1); - strcpy(nx->f, s); - if (col) - { nx->has_arg = 1; - nx->arg_val = atoi(col); - } else - nx->has_arg = 0; nx->nxt = exs; exs = nx; } From ba5b20d73c5efb93e39eeaf417f993b1c5283e3c Mon Sep 17 00:00:00 2001 From: Robert M Date: Sat, 25 Oct 2025 14:05:11 -0400 Subject: [PATCH 2/2] Minor fix: - The install was not installing the man page "uno.1" - .gitignore was missing. --- .gitignore | 8 ++++++++ Src/makefile | 1 + 2 files changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e5d31e --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.o +*.output +Src/c_gram.c +Src/c_gram.h +Src/lexer.c +Src/uno +Src/uno_global +Src/uno_local diff --git a/Src/makefile b/Src/makefile index 4b5216a..bb0550c 100644 --- a/Src/makefile +++ b/Src/makefile @@ -49,6 +49,7 @@ all: uno uno_local uno_global install: all cp uno uno_local uno_global $(BINDIR) + cp ../Doc/uno.1 /usr/local/share/man/man1/. self_test: c_gram.c lexer.c ./mk_uno_suppress