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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:12:33+00:00 2026-05-23T12:12:33+00:00

glibc’s printf("% .0d",0) prints a space, and printf("%+.0d",0) prints a plus sign, and the

  • 0

glibc’s printf("% .0d",0) prints a space, and printf("%+.0d",0) prints a plus sign, and the glib printf test checks for this behavior. But is it correct? From the standard (7.19.6.1):

+ The result of a signed conversion always begins with a plus or minus sign. (It begins with a sign only when a negative value is converted if this flag is not specified.)

space If the first character of a signed conversion is not a sign, or if a signed conversion results in no characters, a space is prefixed to the result. If the space and + flags both appear, the space flag is ignored.

However, regarding precision for the d specifier:

The result of converting a zero value with a precision of zero is no characters.

Naturally this "no characters" rule does not preclude padding the field to the requested width, but as far as I can tell, the prefixed space or + is part of the conversion, and thus subject to the "no characters" rule.

Has this matter ever been clarified?

  • 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-23T12:12:33+00:00Added an answer on May 23, 2026 at 12:12 pm

    No, it’s talking about the basic conversion without modifiers; that’s why the modifiers specifically say what they do when the basic conversion produces no characters.

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

Sidebar

Related Questions

In glibc-2.13/nptl/sigaction.c , i just put a simple printf(test\n); and my glibc compilation fails.
* glibc detected * malloc(): memory corruption (fast): *** This is the error I
I try to create cross toolchian for arm but have this error: In file
Is fprintf thread-safe? The glibc manual seems to say it is, but my application,
I'm trying to run the following: yum reinstall glibc --downloadonly --downloaddir=/root/dependencies/ But it keeps
My linux (SLES-8) server currently has glibc-2.2.5-235, but I have a program which won't
what are differences in the strength and features in gnulib glib and glibc Thanks!
I do realize there are some glibc detected posts but I would be very
Is there a way with feature test macros to have glibc expose GNU extensions
I also want to know whether glibc malloc() does this.

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.