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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:32:01+00:00 2026-06-14T12:32:01+00:00

When reading nginx source code, I find this line: #define NGX_INT32_LEN sizeof(-2147483648) – 1

  • 0

When reading nginx source code, I find this line:

#define NGX_INT32_LEN   sizeof("-2147483648") - 1

why using sizeof(“-2147483648”) – 1?

not sizeof(-2147483648) – 1

not -2147483648 – 1

not -2147483649
or else?

What’s the difference?

  • 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-14T12:32:03+00:00Added an answer on June 14, 2026 at 12:32 pm

    Basically -2147483648 is the widest, in terms of characters required for its representation, of any of the signed 32-bit integers. This macro NGX_INT32_LEN defines how many characters long such an integer can be.

    It does this by taking the amount of space needed for that string constant, and subtracting 1 (because sizeof will provided space for the trailing NUL character). It’s quicker than using:

    strlen("-2147483648")
    

    because not all compilers will translate that into the constant 11.

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

Sidebar

Related Questions

I'm reading source code of nginx and find it's not initializing many of the
When I was reading the nginx code, I have seen this function : #define
Reading this article on nginx website, I'm interested in using X-Accel-Redirect header in the
Reading source code of my current project, I see: [self retain] in one class,
Reading code from other posts, I'm seeing something like this. struct Foo { Foo()
Reading this site, I've found this : [The] line private static final Foo INSTANCE
Reading this question I found this as (note the quotation marks) code to solve
I just installed nginx and php fastcgi about an hour ago, and after reading
Reading manual about Sling http://sling.apache.org/site/46-line-blog.html added folder blog and blog.html to destination: \launchpad\content\src\main\resources\content\ but
Reading the Scala by Example book and there is this example when Martin explains

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.