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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:19:45+00:00 2026-05-25T23:19:45+00:00

LLVM 2.1 has an option that enables warnings for missing function prototypes. When enabled,

  • 0

LLVM 2.1 has an option that enables warnings for “missing function prototypes.” When enabled, the warning will complain about a file like this:

double square( double d )
{
    return d*d;
}
void main()
{
    // ...
}

The function “square” will trigger a warning because it is defined without having been declared (prototyped). You can eliminate the warning thus:

double square( double d );
double square( double d )
{
    return d*d;
}
void main()
{
    // ...
}

I’ve programmed in C++ for twenty years and I’ve never seen a warning like this. It does not seem useful to me.

By default, this warning is enabled in new Mac console projects (at least) in Xcode 4.1. Evidently someone found it useful enough to first implement it and then enable it by default.

Why is this a useful warning? Why does LLVM have it as an option? Why is the option enabled by default on Xcode?

  • 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-25T23:19:46+00:00Added an answer on May 25, 2026 at 11:19 pm

    The compiler uses the prototype declaration to match types for the function definition.
    If you are writing the prototype in a header(interface) file and the implementation in the source file then this warning (by forcing you to provide a declaration, effectively) would prevent you from making a typo error where function definition is different than the one in declaration.

    Though, without such an warning, you would get the errors while linking. One might end up wondering what the actual problem is(n number of reasons for linking errors).

    The warning during compilation stage is much better indication of error than a linking error.

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

Sidebar

Related Questions

LLVM has it's own hand rolled alternative to RTTI that is a speed improvement
LLVM 2.6 + clang. Trying to compile C++ file and got: clang: warning: not
With GCC, when the -Wall -Wextra flags are enabled, one has the option of
It's clear that Apple has an OpenCL implementation based on Clang and LLVM. There's
I have a subclass of NSObject that implements an -(id)initWithRootElement:(MyElement *)e method. NSXMLDocument has
I work on an iPad application that has a sync process that uses web
I compared gcc and llvm-gcc with -O3 option on hmmer and mcf in spec
This has me scratching my head. I have a view controller that implements UIPopoverControllerDelegate
Could someone point out the differences between the open64 and llvm? I know that
Has anybody successfully build Mesa 7.10 with llvmpipe driver using LLVM 2.8 on Windows

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.