From: michaelforney <michaelforney@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Minor pedantic fixes
Date: Fri, 25 Sep 2020 00:29:03 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-185@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
There is a new pull request by michaelforney against master on the mblaze repository
https://github.com/michaelforney/mblaze pedantic-fixes
https://github.com/leahneukirchen/mblaze/pull/185
Minor pedantic fixes
Just a couple of things I noticed when building with `CFLAGS='-std=c99 -Wpedantic -D_XOPEN_SOURCE=700`.
A patch file from https://github.com/leahneukirchen/mblaze/pull/185.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pedantic-fixes-185.patch --]
[-- Type: text/x-diff, Size: 2268 bytes --]
From 875a6e70356b6bc3d6d72d8d2a91d9012ec641e7 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Thu, 17 Sep 2020 12:16:34 -0700
Subject: [PATCH 1/2] include strings.h for str(n)casecmp
These POSIX functions are declared in strings.h, so include this
header explicitly instead of relying on the libc's default feature-test
macros to include it through string.h.
---
magrep.c | 1 +
mdeliver.c | 1 +
mflow.c | 1 +
mhdr.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/magrep.c b/magrep.c
index 6f93a57..72ce1bb 100644
--- a/magrep.c
+++ b/magrep.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "blaze822.h"
diff --git a/mdeliver.c b/mdeliver.c
index 161cea5..27c4b9c 100644
--- a/mdeliver.c
+++ b/mdeliver.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "blaze822.h"
diff --git a/mflow.c b/mflow.c
index af6755d..1013da5 100644
--- a/mflow.c
+++ b/mflow.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "blaze822.h"
diff --git a/mhdr.c b/mhdr.c
index d434d1d..83bed02 100644
--- a/mhdr.c
+++ b/mhdr.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
#include "blaze822.h"
From 33ea06a5b61debdf9bbced2bc546b342ab4aa0cc Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Thu, 17 Sep 2020 12:24:08 -0700
Subject: [PATCH 2/2] mpick: use function pointer type for callback
Though POSIX requires this conversion to work correctly (for dlsym),
it is not valid in ISO C, so it is better to just uses the appropriate
function pointer type.
---
mpick.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mpick.c b/mpick.c
index 379200d..3b11e67 100644
--- a/mpick.c
+++ b/mpick.c
@@ -1466,7 +1466,7 @@ main(int argc, char *argv[])
xpledge("stdio rpath wpath cpath proc exec", 0);
- void *cb = need_thr ? collect : oneline;
+ void (*cb)(char *) = need_thr ? collect : oneline;
if (argc == optind && isatty(0))
i = blaze822_loop1(":", cb);
else
next reply other threads:[~2020-09-24 22:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 22:29 michaelforney [this message]
2020-09-25 12:54 ` [PR PATCH] [Closed]: " leahneukirchen
2020-09-25 12:54 ` leahneukirchen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-185@inbox.vuxu.org \
--to=michaelforney@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).