Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7877019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:15:51+00:00 2026-06-03T03:15:51+00:00

I get the following error with gcc when I declare a struct netif *

  • 0

I get the following error with gcc when I declare a struct netif * from a function scope (where the compile doesn’t complain) to global scope:

src/main.c:114:3: warning: passing argument 1 of 'low_level_init' from incompatible pointer type [enabled by default]
src/main.c:62:13: note: expected 'struct netif *' but argument is of type 'struct netif *'

Why is does compiler give the following “non-sensical” complaint?

expected 'stuct netif *' but argument is of type 'struct netif *'

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:15:53+00:00Added an answer on June 3, 2026 at 3:15 am

    This “full program”

    void foonetif(struct netif *dst) {
      if (dst) return;
      return;
    }
    
    struct netif {
      double bar;
    };
    
    int main(void) {
      struct netif *netif = 0; /* NULL */
      foonetif(netif);
      return 0;
    }
    

    generates this output from gcc 10398683.c (gcc version 4.6.3), so with all default options

    10398683.c:1:22: warning: ‘struct netif’ declared inside parameter list [enabled by default]
    10398683.c:1:22: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
    10398683.c: In function ‘main’:
    10398683.c:12:3: warning: passing argument 1 of ‘newnetif’ from incompatible pointer type [enabled by default]
    10398683.c:1:6: note: expected ‘struct netif *’ but argument is of type ‘struct netif *’
    

    Note the last warning (really a note) 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On the 2nd for-loop, I get the following error from gcc: error: expected unqualified-id
I get following error when trying to access Xampp from a network I've tried
OSX Lion, Xcode 4.2, GCC 4.2 I get the following error installing bson_ext 1.4.1
After running: sudo easy_install lxml I get the following error: src/lxml/lxml.etree.c:165527: fatal error: error
I get the following error when trying to compile an application using pthreads on
The following code doesn't compile with gcc, but does with Visual Studio: template <typename
I get following error when deploying on test server with II6 and Framework 3.5
I get following error: 2012-04-04 23:46:18.374 istiqlaltv[17121:e903] -[istiqlaltvViewController moviePlayBackDidFinish]: unrecognized selector sent to instance
Why do I get following error when trying to start a ruby on rails
I am using the code as described in this question. However get following error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.