Tuesday, November 08, 2022

[fix] sysutils/cpuid implicitly declaring library function 'isprint'

Hello,

I'm playing with sysutils/cpuid and noticed the easy to fix warning:

cpuid.c:35:37: warning: implicitly declaring library function 'isprint' with type 'int (int)' [-Wimplicit-function-declaration]
c = value & 0xff; putchar(isprint(c) ? c : '?');
^
cpuid.c:35:37: note: include the header <ctype.h> or explicitly provide a declaration for 'isprint'

OK?

Index: files/cpuid.c
===================================================================
RCS file: /cvs/ports/sysutils/cpuid/files/cpuid.c,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 cpuid.c
--- files/cpuid.c 25 Apr 2016 18:28:14 -0000 1.1.1.1
+++ files/cpuid.c 8 Nov 2022 11:30:17 -0000
@@ -15,7 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

-
+#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <limits.h>

No comments:

Post a Comment