netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool 1/2] Fix missing function declarations when building tests
Date: Fri, 09 Oct 2015 04:03:27 +0100	[thread overview]
Message-ID: <1444359807.2956.294.camel@decadent.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Fix these compiler warnings by declaring test_exit() and test_main()
regardless of whether TEST_NO_WRAPPERS is defined:

test-cmdline.c: In function ‘send_ioctl’:
test-cmdline.c:268:2: warning: implicit declaration of function ‘test_exit’ [-Wimplicit-function-declaration]
  test_exit(0);
  ^
test-common.c: In function ‘test_cmdline’:
test-common.c:361:21: warning: implicit declaration of function ‘test_main’ [-Wimplicit-function-declaration]
  rc = rc ? rc - 1 : test_main(argc, argv);
                     ^

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
These warnings are longstanding so I'm not sure why I didn't notice
them before!  I've applied this post-4.2.

Ben.

 internal.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/internal.h b/internal.h
index 444810d..156770c 100644
--- a/internal.h
+++ b/internal.h
@@ -132,10 +132,11 @@ struct cmd_expect {
 int test_ioctl(const struct cmd_expect *expect, void *cmd);
 #define TEST_IOCTL_MISMATCH (-2)
 
-#ifndef TEST_NO_WRAPPERS
 int test_main(int argc, char **argp);
-#define main(...) test_main(__VA_ARGS__)
 void test_exit(int rc) __attribute__((noreturn));
+
+#ifndef TEST_NO_WRAPPERS
+#define main(...) test_main(__VA_ARGS__)
 #undef exit
 #define exit(rc) test_exit(rc)
 void *test_malloc(size_t size);

-- 
Ben Hutchings
If the facts do not conform to your theory, they must be disposed of.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

                 reply	other threads:[~2015-10-09  3:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1444359807.2956.294.camel@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=netdev@vger.kernel.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).