public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] makedoc: exit with non-zero status on error
Date: Thu, 07 Dec 2017 11:56:00 -0000	[thread overview]
Message-ID: <20171207115620.106915.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=06bd0ecc8dc472e3b2c3d54de994c11122559ee2

commit 06bd0ecc8dc472e3b2c3d54de994c11122559ee2
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Dec 4 18:24:55 2017 +0000

    makedoc: exit with non-zero status on error
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 newlib/doc/makedoc.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c
index fdcc5b9..45ddfb8 100644
--- a/newlib/doc/makedoc.c
+++ b/newlib/doc/makedoc.c
@@ -1113,9 +1113,10 @@ DEFUN(lookup_word,(word),
     
 }
 
-static void DEFUN_VOID(perform)
+static int DEFUN_VOID(perform)
 {
     tos = stack;
+    int errors = 0;
     
     while (at(ptr, idx)) {
 	    /* It's worth looking through the command list */
@@ -1140,6 +1141,7 @@ static void DEFUN_VOID(perform)
 		else
 		{
 		    fprintf(stderr,"warning, %s is not recognised\n",  next);
+		    errors++;
 		    skip_past_newline();
 		}
 		
@@ -1147,6 +1149,7 @@ static void DEFUN_VOID(perform)
 	    else skip_past_newline();
 
 	}
+    return errors;
 }
 
 dict_type *
@@ -1220,6 +1223,8 @@ DEFUN(compile, (string),
     int  ret=0;
     /* add words to the dictionary */
     char *word;
+    dict_type *lookup;
+
     string = nextword(string, &word);
     while (string && *string && word[0]) 
     {
@@ -1275,7 +1280,9 @@ DEFUN(compile, (string),
 		     break;
 		   default:
 		     add_to_definition(ptr, call);
-		     add_to_definition(ptr, lookup_word(word));
+		     lookup = lookup_word(word);
+		     if (!lookup) ret++;
+		     add_to_definition(ptr, lookup);
 		 }
 
 		string = nextword(string, &word);		     
@@ -1349,7 +1356,7 @@ int ac AND
 char *av[])
 {
     unsigned int i;
-    
+    int status = 0;
 
     string_type buffer;
     string_type pptr;
@@ -1410,7 +1417,7 @@ char *av[])
 		  
 		read_in(&b, f);
 		if( compile(b.ptr) )  { fclose(f); exit(1); }
-		perform();	
+		status = perform();
 		fclose(f);
 	    }
 	    else    if (av[i][1] == 'i') 
@@ -1425,8 +1432,5 @@ char *av[])
 
     }      
     write_buffer(stack+0);
-    return 0;
+    return status;
 }
-
-
-


                 reply	other threads:[~2017-12-07 11:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171207115620.106915.qmail@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).