Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: add quotes around placeholder in m...



details:   https://anonhg.NetBSD.org/src/rev/7708e20c0bc3
branches:  trunk
changeset: 984999:7708e20c0bc3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Aug 03 18:44:33 2021 +0000

description:
lint: add quotes around placeholder in message 214

function '%s' expects to return value

diffstat:

 tests/usr.bin/xlint/lint1/c11_generic_expression.exp   |  2 +-
 tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp |  2 +-
 tests/usr.bin/xlint/lint1/d_fold_test.exp              |  2 +-
 tests/usr.bin/xlint/lint1/expr_cast.c                  |  4 ++--
 tests/usr.bin/xlint/lint1/expr_cast.exp                |  2 +-
 tests/usr.bin/xlint/lint1/msg_096.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_109.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_126.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_170.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_204.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_214.c                    |  7 +++----
 tests/usr.bin/xlint/lint1/msg_214.exp                  |  2 +-
 tests/usr.bin/xlint/lint1/msg_343.exp                  |  2 +-
 usr.bin/xlint/lint1/err.c                              |  6 +++---
 usr.bin/xlint/lint1/func.c                             |  6 +++---
 15 files changed, 22 insertions(+), 23 deletions(-)

diffs (186 lines):

diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/c11_generic_expression.exp
--- a/tests/usr.bin/xlint/lint1/c11_generic_expression.exp      Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.exp      Tue Aug 03 18:44:33 2021 +0000
@@ -1,4 +1,4 @@
-c11_generic_expression.c(29): warning: function classify_type_without_default expects to return value [214]
+c11_generic_expression.c(29): warning: function 'classify_type_without_default' expects to return value [214]
 c11_generic_expression.c(21): warning: argument 'var' unused in function 'classify_type_without_default' [231]
 c11_generic_expression.c(37): warning: argument 'var' unused in function 'classify_type_with_default' [231]
 c11_generic_expression.c(53): warning: argument 'c' unused in function 'classify_char' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp    Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.exp    Tue Aug 03 18:44:33 2021 +0000
@@ -3,4 +3,4 @@
 d_c99_bool_strict_syshdr.c(87): error: operands of '=' have incompatible types (_Bool != int) [107]
 d_c99_bool_strict_syshdr.c(162): error: return value type mismatch (_Bool) and (int) [211]
 d_c99_bool_strict_syshdr.c(175): error: operand of '!' must be bool, not 'int' [330]
-d_c99_bool_strict_syshdr.c(175): warning: function str_equal_bad expects to return value [214]
+d_c99_bool_strict_syshdr.c(175): warning: function 'str_equal_bad' expects to return value [214]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/d_fold_test.exp
--- a/tests/usr.bin/xlint/lint1/d_fold_test.exp Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_fold_test.exp Tue Aug 03 18:44:33 2021 +0000
@@ -10,5 +10,5 @@
 d_fold_test.c(67): error: controlling expressions must have scalar type [204]
 d_fold_test.c(67): warning: argument 's' unused in function 'do_while_struct' [231]
 d_fold_test.c(70): error: first operand must have scalar type, op ? : [170]
-d_fold_test.c(70): warning: function conditional_struct expects to return value [214]
+d_fold_test.c(70): warning: function 'conditional_struct' expects to return value [214]
 d_fold_test.c(70): warning: argument 's' unused in function 'conditional_struct' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/expr_cast.c
--- a/tests/usr.bin/xlint/lint1/expr_cast.c     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_cast.c     Tue Aug 03 18:44:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: expr_cast.c,v 1.2 2021/08/03 18:38:02 rillig Exp $     */
+/*     $NetBSD: expr_cast.c,v 1.3 2021/08/03 18:44:33 rillig Exp $     */
 # 3 "expr_cast.c"
 
 /*
@@ -28,6 +28,6 @@
        };
 
        /* expect+2: error: invalid cast from 'struct S' to 'struct S' [147] */
-       /* expect+1: warning: function cast expects to return value [214] */
+       /* expect+1: warning: function 'cast' expects to return value [214] */
        return (struct S)local;
 }
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/expr_cast.exp
--- a/tests/usr.bin/xlint/lint1/expr_cast.exp   Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_cast.exp   Tue Aug 03 18:44:33 2021 +0000
@@ -1,2 +1,2 @@
 expr_cast.c(32): error: invalid cast from 'struct S' to 'struct S' [147]
-expr_cast.c(32): warning: function cast expects to return value [214]
+expr_cast.c(32): warning: function 'cast' expects to return value [214]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_096.exp
--- a/tests/usr.bin/xlint/lint1/msg_096.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_096.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -1,3 +1,3 @@
 msg_096.c(21): error: cannot dereference non-pointer type [96]
-msg_096.c(21): warning: function unary_asterisk expects to return value [214]
+msg_096.c(21): warning: function 'unary_asterisk' expects to return value [214]
 msg_096.c(19): warning: argument 'i' unused in function 'unary_asterisk' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_109.exp
--- a/tests/usr.bin/xlint/lint1/msg_109.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_109.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -1,3 +1,3 @@
 msg_109.c(9): error: void type illegal in expression [109]
-msg_109.c(9): warning: function example expects to return value [214]
+msg_109.c(9): warning: function 'example' expects to return value [214]
 msg_109.c(7): warning: argument 'arg' unused in function 'example' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_126.exp
--- a/tests/usr.bin/xlint/lint1/msg_126.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_126.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -1,5 +1,5 @@
 msg_126.c(9): error: incompatible types 'pointer to void' and 'double' in conditional [126]
-msg_126.c(9): warning: function max expects to return value [214]
+msg_126.c(9): warning: function 'max' expects to return value [214]
 msg_126.c(7): warning: argument 'cond' unused in function 'max' [231]
 msg_126.c(7): warning: argument 'ptr' unused in function 'max' [231]
 msg_126.c(7): warning: argument 'dbl' unused in function 'max' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_170.exp
--- a/tests/usr.bin/xlint/lint1/msg_170.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_170.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -1,3 +1,3 @@
 msg_170.c(13): error: first operand must have scalar type, op ? : [170]
-msg_170.c(13): warning: function example expects to return value [214]
+msg_170.c(13): warning: function 'example' expects to return value [214]
 msg_170.c(11): warning: argument 'num' unused in function 'example' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_204.exp
--- a/tests/usr.bin/xlint/lint1/msg_204.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_204.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -10,5 +10,5 @@
 msg_204.c(95): error: controlling expressions must have scalar type [204]
 msg_204.c(95): warning: argument 's' unused in function 'do_while_struct' [231]
 msg_204.c(101): error: first operand must have scalar type, op ? : [170]
-msg_204.c(101): warning: function conditional_struct expects to return value [214]
+msg_204.c(101): warning: function 'conditional_struct' expects to return value [214]
 msg_204.c(101): warning: argument 's' unused in function 'conditional_struct' [231]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_214.c
--- a/tests/usr.bin/xlint/lint1/msg_214.c       Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_214.c       Tue Aug 03 18:44:33 2021 +0000
@@ -1,12 +1,11 @@
-/*     $NetBSD: msg_214.c,v 1.3 2021/08/03 18:38:02 rillig Exp $       */
+/*     $NetBSD: msg_214.c,v 1.4 2021/08/03 18:44:33 rillig Exp $       */
 # 3 "msg_214.c"
 
-// Test for message: function %s expects to return value [214]
+// Test for message: function '%s' expects to return value [214]
 
 int
 int_function(void)
 {
-       /* TODO: add quotes around '%s' */
-       /* expect+1: warning: function int_function expects to return value [214] */
+       /* expect+1: warning: function 'int_function' expects to return value [214] */
        return;
 }
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_214.exp
--- a/tests/usr.bin/xlint/lint1/msg_214.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_214.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -1,1 +1,1 @@
-msg_214.c(11): warning: function int_function expects to return value [214]
+msg_214.c(10): warning: function 'int_function' expects to return value [214]
diff -r 5511cf2ec44c -r 7708e20c0bc3 tests/usr.bin/xlint/lint1/msg_343.exp
--- a/tests/usr.bin/xlint/lint1/msg_343.exp     Tue Aug 03 18:38:02 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_343.exp     Tue Aug 03 18:44:33 2021 +0000
@@ -3,6 +3,6 @@
 msg_343.c(27): error: static array size is a C11 extension [343]
 msg_343.c(34): error: syntax error '3' [249]
 msg_343.c(38): error: cannot dereference non-pointer type [96]
-msg_343.c(38): warning: function returns_volatile_int_array expects to return value [214]
+msg_343.c(38): warning: function 'returns_volatile_int_array' expects to return value [214]
 msg_343.c(47): error: syntax error ']' [249]
 msg_343.c(47): error: static array size is a C11 extension [343]
diff -r 5511cf2ec44c -r 7708e20c0bc3 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Tue Aug 03 18:38:02 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Tue Aug 03 18:44:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.132 2021/07/31 19:07:52 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.133 2021/08/03 18:44:33 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.132 2021/07/31 19:07:52 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.133 2021/08/03 18:44:33 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -268,7 +268,7 @@
        "return value type mismatch (%s) and (%s)",                   /* 211 */
        "cannot return incomplete type",                              /* 212 */
        "void function %s cannot return value",                       /* 213 */
-       "function %s expects to return value",                        /* 214 */
+       "function '%s' expects to return value",                      /* 214 */
        "function '%s' implicitly declared to return int",            /* 215 */
        "function %s has return (e); and return;",                    /* 216 */
        "function %s falls off bottom without returning value",       /* 217 */
diff -r 5511cf2ec44c -r 7708e20c0bc3 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Tue Aug 03 18:38:02 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Tue Aug 03 18:44:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.118 2021/08/01 06:40:37 rillig Exp $        */
+/*     $NetBSD: func.c,v 1.119 2021/08/03 18:44:33 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.118 2021/08/01 06:40:37 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.119 2021/08/03 18:44:33 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -1080,7 +1080,7 @@
                 * is explicitly declared.
                 */
                if (!funcsym->s_return_type_implicit_int)
-                       /* function %s expects to return value */
+                       /* function '%s' expects to return value */
                        warning(214, funcsym->s_name);
        }
 



Home | Main Index | Thread Index | Old Index