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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:44:05+00:00 2026-05-30T17:44:05+00:00

Possible Duplicate: Error: No previous prototype for function. Why am I getting this error?

  • 0

Possible Duplicate:
Error: No previous prototype for function. Why am I getting this error?

I have a function that I prototyped in the header file, however Xcode still gives me warning No previous prototype for the function 'printBind'. I have the function setBind prototyped in the same way but I do not get an warning for this function in my implementation.

CelGL.h

#ifndef Under_Siege_CelGL_h
#define Under_Siege_CelGL_h

void setBind(int input);
void printBind();

#endif

CelGL.c

#include <stdio.h>
#include "CelGL.h"

int bind;

void setBind(int bindin) { // No warning here?
    bind = bindin;
}

void printBind() { // Warning here
    printf("%i", bind);
}
  • 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-30T17:44:06+00:00Added an answer on May 30, 2026 at 5:44 pm

    In C, this:

    void printBind();
    

    is not a prototype. It declares a function that returns nothing (void) but takes an indeterminate list of arguments. (However, that list of arguments is not variable; all functions taking a variable length argument list must have a full prototype in scope to avoid undefined behaviour.)

    void printBind(void);
    

    That’s a prototype for the function that takes no arguments.

    The rules in C++ are different – the first declares a function with no arguments and is equivalent to the second.

    The reason for the difference is historical (read ‘dates back to the mid-1980s’). When prototypes were introduced into C (some years after they were added to C++), there was an enormous legacy of code that declared functions with no argument list (because that wasn’t an option before prototypes were added), so backwards compatibility considerations meant that SomeType *SomeFunction(); had to continue meaning ‘a function that returns a SomeType * but for which we know nothing about the argument list’. C++ eventually added the SomeType *SomeFunction(void); notation for compatibility with C, but didn’t need it since type-safe linkage was added early and all functions needed a prototype in scope before they were defined or used.

    Note that C23 finally brings C into alignment with C++ and the empty parenthesis notation means that the function declaration is a prototype for a function taking no arguments.

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

Sidebar

Related Questions

Possible Duplicate: pthread Function from a Class I am getting an error (Can not
Possible Duplicate: Error with address of parenthesized member function In this recent question the
Possible Duplicate: Error handling in C code Let's say you have a function: int
Possible Duplicate: PHP error: Cannot modify header information – headers already sent I have
Possible Duplicate: PHP ToString() equivalent I get this error: Catchable fatal error: Object of
Possible Duplicate: raise error within MySql function In MsSQL I can raise a custom
Possible Duplicate: Undefined reference - C++ linker error Now, I'm getting an Undefined reference
Possible Duplicate: R cannot be resolved - Android error The errors I have are
Possible Duplicate: Java how to: Generic Array creation Error generic array creation I have
Possible Duplicate: PHP error: Cannot modify header information – headers already sent I've built

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.