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

  • Home
  • SEARCH
  • 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 8390737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:04:50+00:00 2026-06-09T19:04:50+00:00

I have a question about default argument promotions in C99 standard. In the book

  • 0

I have a question about default argument promotions in C99 standard. In the book “C Programming – A Modern Approach, 2nd Edition” I’ve read that:

Argument Conversions:

[…]

1) The compiler has encountered a prototype prior to the call. […]

2) The compiler has not encountered a prototype prior to the call. The compiler performs the default argument promotions: (1)floatarguments are converted todouble. (2) The integral promotions are performed, causingcharandshortarguments to be converted toint. (In C99, the integer promotions are performed.)

A few lines further is shown an example in which there is no function prototype or definition before calling it. It is commented as follows:

Of course, a much better solution is to provide a prototype forsquarebefore calling it. In C99, callingsquarewithout first providing a declaration or definition of the function is an error.

Aren’t those two cursive sentences kind of contrary with each other? I mean, if C99 forbids calling functions without previous declaration/definition how can it determine promotions in that kind of function call?

  • 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-09T19:04:52+00:00Added an answer on June 9, 2026 at 7:04 pm

    No they are not contradictory.

    A declaration is not necessarily a prototype:

    int f();
    

    declares the function f but isn’t a prototype since nothing is known about the argument types.

    int (a)
     in a;
    {
     ...
    }
    

    is a definition but isn’t a prototype either.

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

Sidebar

Related Questions

Setup I have a few questions about the default argument promotions when calling a
i have a question about using GalleryView. At first, i set five default images
I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The
i have a question about the default min value of a date in mysql
I have a question about Java. I have an Object[] (Java default, not the
I have some question about functions which have default parameters. import sys from random
I have a question about the default behavior of JavaScript's parseFloat function in different
Just one easy question about default parameter values in the routing. If I have
I have a question about the default initialization in C++. I was told the
I have the question about Properties.Settings.Default generation. By default there are only defaultInstance is

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.