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 4340256
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:19:29+00:00 2026-05-21T11:19:29+00:00

Rookie question FYI. Whenever I compile/run the code, extern tolayer2(rtpktTo1); I receive a warning.

  • 0

Rookie question FYI.

Whenever I compile/run the code, extern tolayer2(rtpktTo1); I receive a warning.
The warning reads, as in the title, Warning: parameter names (without types) in function declaration

Any help appreciated.

node0.c

extern struct rtpkt {
  int sourceid;       /* id of sending router sending this pkt */
  int destid;         /* id of router to which pkt being sent 
                         (must be an immediate neighbor) */
  int mincost[4];    /* current understanding of min cost to node 0 ... 3 */
  };

/* Create routing packets (rtpkt) and send to neighbors via tolayer2(). */
    struct rtpkt rtpktTo1;
        rtpktTo1.sourceid = 0;
        rtpktTo1.destid = 1;
        rtpktTo1.mincost[0] = minCost[0];
        rtpktTo1.mincost[1] = minCost[1];
        rtpktTo1.mincost[2] = minCost[2];
        rtpktTo1.mincost[3] = minCost[3];

extern tolayer2(rtpktTo1);

prog3.c

tolayer2(packet)
  struct rtpkt packet;
{
  /* This has a lot of code in it */ 
}
  • 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-05-21T11:19:30+00:00Added an answer on May 21, 2026 at 11:19 am

    The assignments to rkpktTo1.* are not apparently in a function or declaration, unless this is a code fragment. Wrap them in a function. The warning is a bit misleading.

    The declaration of tolayer2() should have a return type as well as a parameter type. Since there isn’t one, int is assumed. This may not be what is intended, but it should compile without warnings and errors:

    node0.c

    struct rtpkt {
      int sourceid;       /* id of sending router sending this pkt */
      int destid;         /* id of router to which pkt being sent 
                             (must be an immediate neighbor) */
      int mincost[4];    /* current understanding of min cost to node 0 ... 3 */
      };
    
    /* Create routing packets (rtpkt) and send to neighbors via tolayer2(). */
    void function () {
        struct rtpkt rtpktTo1;
            rtpktTo1.sourceid = 0;
            rtpktTo1.destid = 1;
            rtpktTo1.mincost[0] = minCost[0];
            rtpktTo1.mincost[1] = minCost[1];
            rtpktTo1.mincost[2] = minCost[2];
            rtpktTo1.mincost[3] = minCost[3];
    }
    extern void tolayer2(struct rtpkt *rtpktTo1);
    

    prog3.c

    void
    tolayer2(struct rtpkt *packet)
    {
      /* This has a lot of code in it */ 
    }
    

    Passing a structure by value is often not appropriate, so I have changed it to pass by reference.

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

Sidebar

Related Questions

Rookie question: I have been experiencing a minor bug in my mvc2 application. I
Sorry for the rookie question, as I'm just starting out with C#. I have
Okay this is probably a rookie question, but I have never done GUI programming
I'm a programmer and relatively new to cryptography, so pardon my rookie question. :)
I've been reading through a lot of the rookie Java questions on finalize() and
I am a rookie was using the Visual Studio 2008 built-in Unit Testing components,
I'm a rookie designer having a few troubles with this page: http://www.resolvegroup.co.nz/javasurvey.php There are
So I have an R file that I would like to schedule to run
Bit of an Objective-C rookie, I've looked around for an answer but haven't been
I first have to say that I really am a rookie in caching, so

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.