[PATCH] cwm: use PRId64 for numberstring formatting
Ricardson <[email protected]>
| Newsgroups | gmane.os.openbsd.misc |
|---|---|
| Message-ID | <CAAq5vGA-xzeWMJQBt_gJY8A3wu6waq5_mBdZO60o-tii=2pYSg@mail.gmail.com> |
Hello, This patch fixes a format warning on systems where int64_t is defined as long rather than long long. The current "%lld" format in parse.y does not match int64_t on such systems. Using PRId64 makes the format portable without changing the generated configuration text. The patch was tested by building cwm on Linux with GCC. It applies cleanly to the current Xenocara cwm source. -- Regards r1w1s1
cwm-openbsd-numberstring.patch
(application/x-patch, 350 B)
--- a/parse.y
+++ b/parse.y
@@ -22,6 +22,7 @@
%{
#include <sys/types.h>
+#include <inttypes.h>
#include <sys/queue.h>
#include <ctype.h>
@@ -106,7 +107,7 @@
numberstring : NUMBER {
char *s;
- if (asprintf(&s, "%lld", $1) == -1) {
+ if (asprintf(&s, "%" PRId64, $1) == -1) {
yyerror("string: asprintf");
YYERROR;
}