[hackers] [scc] [cc1] Do not recover in incorrect return type || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 20 May 2016 15:34:07 +0200 (CEST)

commit faeb157307bc3ff25fa560b5c0a2c62494aa3d55
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri May 20 15:23:57 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri May 20 15:23:57 2016 +0200

    [cc1] Do not recover in incorrect return type
    
    In this case we don't have to recover the error,
    we can continue with the parsing without problems
    here.

diff --git a/cc1/stmt.c b/cc1/stmt.c
index 620d472..2896ac6 100644
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
_AT_@ -158,7 +158,7 @@ Return(Symbol *lbreak, Symbol *lcont, Switch *lswitch)
                 if (tp == voidtype)
                         warn("function returning void returns a value");
                 else if ((np = convert(np, tp, 0)) == NULL)
- error("incorrect type in return");
+ errorp("incorrect type in return");
         }
         emit(ORET, NULL);
         emit(OEXPR, np);
Received on Fri May 20 2016 - 15:34:07 CEST

This archive was generated by hypermail 2.3.0 : Fri May 20 2016 - 15:36:16 CEST