Module Name:    src
Committed By:   rillig
Date:           Sun Aug 15 15:12:36 UTC 2021

Modified Files:
        src/lib/libcurses: get_wstr.c getstr.c in_wchstr.c inchstr.c instr.c
            inwstr.c

Log Message:
libcurses: fix usage of __warn_references

Since that macro can expand to an empty token list, it adds its own
semicolon as needed.  Removing the extra semicolon fixes the lint
warnings about empty declarations.  These empty declarations are a GCC
extension.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libcurses/get_wstr.c \
    src/lib/libcurses/in_wchstr.c src/lib/libcurses/inwstr.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libcurses/getstr.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/inchstr.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libcurses/instr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/get_wstr.c
diff -u src/lib/libcurses/get_wstr.c:1.8 src/lib/libcurses/get_wstr.c:1.9
--- src/lib/libcurses/get_wstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/get_wstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: get_wstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: get_wstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -61,7 +61,7 @@ getn_wstr(wchar_t *wstr, int n)
  *	Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(get_wstr,
-	"warning: this program uses get_wstr(), which is unsafe.");
+	"warning: this program uses get_wstr(), which is unsafe.")
 int
 get_wstr(wchar_t *wstr)
 {
@@ -83,7 +83,7 @@ mvgetn_wstr(int y, int x, wchar_t *wstr,
  *	  Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvget_wstr(int y, int x, wchar_t *wstr)
 {
@@ -109,7 +109,7 @@ mvwgetn_wstr(WINDOW *win, int y, int x, 
  *	  Get a string from the given window starting at (y, x).
  */
 __warn_references(mvget_wstr,
-	"warning: this program uses mvget_wstr(), which is unsafe.");
+	"warning: this program uses mvget_wstr(), which is unsafe.")
 int
 mvwget_wstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
@@ -124,7 +124,7 @@ mvwget_wstr(WINDOW *win, int y, int x, w
  *	Get a string starting at (cury, curx).
  */
 __warn_references(wget_wstr,
-	"warning: this program uses wget_wstr(), which is unsafe.");
+	"warning: this program uses wget_wstr(), which is unsafe.")
 int
 wget_wstr(WINDOW *win, wchar_t *wstr)
 {
Index: src/lib/libcurses/in_wchstr.c
diff -u src/lib/libcurses/in_wchstr.c:1.8 src/lib/libcurses/in_wchstr.c:1.9
--- src/lib/libcurses/in_wchstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/in_wchstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: in_wchstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: in_wchstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: in_wchstr.c,v 1.8 2019
  *	Return an array of wide characters at cursor position from stdscr.
  */
 __warn_references(in_wchstr,
-	"warning: this program uses in_wchstr(), which is unsafe.");
+	"warning: this program uses in_wchstr(), which is unsafe.")
 int
 in_wchstr(cchar_t *wchstr)
 {
@@ -65,7 +65,7 @@ in_wchnstr(cchar_t *wchstr, int n)
  *  Return an array of wide characters at position (y, x) from stdscr.
  */
 __warn_references(mvin_wchstr,
-	"warning: this program uses mvin_wchstr(), which is unsafe.");
+	"warning: this program uses mvin_wchstr(), which is unsafe.")
 int
 mvin_wchstr(int y, int x, cchar_t *wchstr)
 {
@@ -83,7 +83,7 @@ mvin_wchnstr(int y, int x, cchar_t *wchs
  *  Return an array wide characters at position (y, x) from the given window.
  */
 __warn_references(mvwin_wchstr,
-	"warning: this program uses mvwin_wchstr(), which is unsafe.");
+	"warning: this program uses mvwin_wchstr(), which is unsafe.")
 int
 mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr)
 {
@@ -107,7 +107,7 @@ mvwin_wchnstr(WINDOW *win, int y, int x,
  *	Return an array of characters at cursor position.
  */
 __warn_references(win_wchstr,
-	"warning: this program uses win_wchstr(), which is unsafe.");
+	"warning: this program uses win_wchstr(), which is unsafe.")
 int
 win_wchstr(WINDOW *win, cchar_t *wchstr)
 {
Index: src/lib/libcurses/inwstr.c
diff -u src/lib/libcurses/inwstr.c:1.8 src/lib/libcurses/inwstr.c:1.9
--- src/lib/libcurses/inwstr.c:1.8	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/inwstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*   $NetBSD: inwstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $ */
+/*   $NetBSD: inwstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inwstr.c,v 1.8 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: inwstr.c,v 1.9 2021/08/15 15:12:36 rillig Exp $");
 #endif						  /* not lint */
 
 #include "curses.h"
@@ -47,7 +47,7 @@ __RCSID("$NetBSD: inwstr.c,v 1.8 2019/06
  *	Return a string of wide characters at cursor position from stdscr.
  */
 __warn_references(inwstr,
-	"warning: this program uses inwstr(), which is unsafe.");
+	"warning: this program uses inwstr(), which is unsafe.")
 int
 inwstr(wchar_t *wstr)
 {
@@ -65,7 +65,7 @@ innwstr(wchar_t *wstr, int n)
  *  Return a string of wide characters at position (y, x) from stdscr.
  */
 __warn_references(mvinwstr,
-	"warning: this program uses mvinwstr(), which is unsafe.");
+	"warning: this program uses mvinwstr(), which is unsafe.")
 int
 mvinwstr(int y, int x, wchar_t *wstr)
 {
@@ -83,7 +83,7 @@ mvinnwstr(int y, int x, wchar_t *wstr, i
  *  Return an array wide characters at position (y, x) from the given window.
  */
 __warn_references(mvwinwstr,
-	"warning: this program uses mvwinwstr(), which is unsafe.");
+	"warning: this program uses mvwinwstr(), which is unsafe.")
 int
 mvwinwstr(WINDOW *win, int y, int x, wchar_t *wstr)
 {
@@ -107,7 +107,7 @@ mvwinnwstr(WINDOW *win, int y, int x, wc
  *	Return a string of wide characters at cursor position.
  */
 __warn_references(winwstr,
-	"warning: this program uses winwstr(), which is unsafe.");
+	"warning: this program uses winwstr(), which is unsafe.")
 int
 winwstr(WINDOW *win, wchar_t *wstr)
 {

Index: src/lib/libcurses/getstr.c
diff -u src/lib/libcurses/getstr.c:1.27 src/lib/libcurses/getstr.c:1.28
--- src/lib/libcurses/getstr.c:1.27	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/getstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: getstr.c,v 1.27 2019/06/09 07:40:14 blymn Exp $	*/
+/*	$NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
 #if 0
 static char sccsid[] = "@(#)getstr.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getstr.c,v 1.27 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: getstr.c,v 1.28 2021/08/15 15:12:36 rillig Exp $");
 #endif
 #endif				/* not lint */
 
@@ -61,7 +61,7 @@ getnstr(char *str, int n)
  *	Get a string from stdscr starting at (cury, curx).
  */
 __warn_references(getstr,
-    "warning: this program uses getstr(), which is unsafe.");
+    "warning: this program uses getstr(), which is unsafe.")
 int
 getstr(char *str)
 {
@@ -83,7 +83,7 @@ mvgetnstr(int y, int x, char *str, int n
  *      Get a string from stdscr starting at (y, x).
  */
 __warn_references(mvgetstr,
-    "warning: this program uses mvgetstr(), which is unsafe.");
+    "warning: this program uses mvgetstr(), which is unsafe.")
 int
 mvgetstr(int y, int x, char *str)
 {
@@ -109,7 +109,7 @@ mvwgetnstr(WINDOW *win, int y, int x, ch
  *      Get a string from the given window starting at (y, x).
  */
 __warn_references(mvgetstr,
-    "warning: this program uses mvgetstr(), which is unsafe.");
+    "warning: this program uses mvgetstr(), which is unsafe.")
 int
 mvwgetstr(WINDOW *win, int y, int x, char *str)
 {
@@ -126,7 +126,7 @@ mvwgetstr(WINDOW *win, int y, int x, cha
  *	Get a string starting at (cury, curx).
  */
 __warn_references(wgetstr,
-    "warning: this program uses wgetstr(), which is unsafe.");
+    "warning: this program uses wgetstr(), which is unsafe.")
 int
 wgetstr(WINDOW *win, char *str)
 {

Index: src/lib/libcurses/inchstr.c
diff -u src/lib/libcurses/inchstr.c:1.10 src/lib/libcurses/inchstr.c:1.11
--- src/lib/libcurses/inchstr.c:1.10	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/inchstr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inchstr.c,v 1.10 2019/06/09 07:40:14 blymn Exp $	*/
+/*	$NetBSD: inchstr.c,v 1.11 2021/08/15 15:12:36 rillig Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inchstr.c,v 1.10 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: inchstr.c,v 1.11 2021/08/15 15:12:36 rillig Exp $");
 #endif				/* not lint */
 
 #include "curses.h"
@@ -50,7 +50,7 @@ __RCSID("$NetBSD: inchstr.c,v 1.10 2019/
  *	Return an array of characters at cursor position from stdscr.
  */
 __warn_references(inchstr,
-    "warning: this program uses inchstr(), which is unsafe.");
+    "warning: this program uses inchstr(), which is unsafe.")
 int
 inchstr(chtype *chstr)
 {
@@ -70,7 +70,7 @@ inchnstr(chtype *chstr, int n)
  *      Return an array of characters at position (y, x) from stdscr.
  */
 __warn_references(mvinchstr,
-    "warning: this program uses mvinchstr(), which is unsafe.");
+    "warning: this program uses mvinchstr(), which is unsafe.")
 int
 mvinchstr(int y, int x, chtype *chstr)
 {
@@ -90,7 +90,7 @@ mvinchnstr(int y, int x, chtype *chstr, 
  *      Return an array characters at position (y, x) from the given window.
  */
 __warn_references(mvwinchstr,
-    "warning: this program uses mvwinchstr(), which is unsafe.");
+    "warning: this program uses mvwinchstr(), which is unsafe.")
 int
 mvwinchstr(WINDOW *win, int y, int x, chtype *chstr)
 {
@@ -118,7 +118,7 @@ mvwinchnstr(WINDOW *win, int y, int x, c
  *	Return an array of characters at cursor position.
  */
 __warn_references(winchstr,
-    "warning: this program uses winchstr(), which is unsafe.");
+    "warning: this program uses winchstr(), which is unsafe.")
 int
 winchstr(WINDOW *win, chtype *chstr)
 {

Index: src/lib/libcurses/instr.c
diff -u src/lib/libcurses/instr.c:1.7 src/lib/libcurses/instr.c:1.8
--- src/lib/libcurses/instr.c:1.7	Sun Jun  9 07:40:14 2019
+++ src/lib/libcurses/instr.c	Sun Aug 15 15:12:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $	*/
+/*	$NetBSD: instr.c,v 1.8 2021/08/15 15:12:36 rillig Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: instr.c,v 1.7 2019/06/09 07:40:14 blymn Exp $");
+__RCSID("$NetBSD: instr.c,v 1.8 2021/08/15 15:12:36 rillig Exp $");
 #endif				/* not lint */
 
 #include "curses.h"
@@ -50,7 +50,7 @@ __RCSID("$NetBSD: instr.c,v 1.7 2019/06/
  *	Return a string of characters at cursor position from stdscr.
  */
 __warn_references(instr,
-    "warning: this program uses instr(), which is unsafe.");
+    "warning: this program uses instr(), which is unsafe.")
 int
 instr(char *str)
 {
@@ -69,7 +69,7 @@ innstr(char *str, int n)
  *	XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(mvinstr,
-    "warning: this program uses mvinstr(), which is unsafe.");
+    "warning: this program uses mvinstr(), which is unsafe.")
 int
 mvinstr(int y, int x, char *str)
 {
@@ -88,7 +88,7 @@ mvinnstr(int y, int x, char *str, int n)
  *	XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(mvwinstr,
-    "warning: this program uses mvwinstr(), which is unsafe.");
+    "warning: this program uses mvwinstr(), which is unsafe.")
 int
 mvwinstr(WINDOW *win, int y, int x, char *str)
 {
@@ -115,7 +115,7 @@ mvwinnstr(WINDOW *win, int y, int x, cha
  *	XXX: should be multi-byte characters for SUSv2.
  */
 __warn_references(winstr,
-    "warning: this program uses winstr(), which is unsafe.");
+    "warning: this program uses winstr(), which is unsafe.")
 int
 winstr(WINDOW *win, char *str)
 {

Reply via email to