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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:40:25+00:00 2026-05-26T21:40:25+00:00

I find out that Apple uses the following declaration in OSAtomic.h header: inline static

  • 0

I find out that Apple uses the following declaration in OSAtomic.h header:

inline static int32_t   OSAtomicDecrement32( volatile int32_t *__theValue )
            { return OSAtomicAdd32( -1, __theValue); }

I am getting the following warning when including it and compiling:

warning: 'int32_t OSAtomicDecrement32(volatile int32_t*)' defined but not used

That is true, but I would like to know answers to the following:

  1. Do they really need to have this symbol defined in some library (to get rid of this warning)? If the function OSAtomicDecrement32 can be created only by calling OSAtomicAdd32, why one can’t define this in a header directly? Should they use #define OSAtomicDecrement32 …body.. instead?

  2. If I don’t call OSAtomicDecrement32 in my program, why does it complain that symbol OSAtomicAdd32 is undefined (when I don’t link with a library which defines it)? It is inline, I thought that when I don’t use something, the compiler would strip it off…

Thanks for explaining it to me!

  • 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-26T21:40:25+00:00Added an answer on May 26, 2026 at 9:40 pm

    I guess the reason for gcc complaining about this is the static keyword which results in code for this function to be emitted in any compilation unit. They just shouldn’t do it like this. Either they’d use

    • clear C99 standard code. Then they’d just have to do inline without
      static and provide the symbol in just one library, libc e.g.
    • use compiler extensions like gcc’s (and thus clang’s) attribute
      always_inline

    but never static.

    BTW, gcc has extension for this operations (prefixed with __sync IIRC) that would be portable to other systems where there is gcc, clang, icc, opencc…

    Perhaps you could get around this by adding some arguments to the gcc call. Try -std=c99 or switch off the corresponding warning.

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

Sidebar

Related Questions

How could you find out that an Exception occurred in a Thread in a
e.g., how can I find out that the executable has been installed in /usr/bin/python
I was shocked to find out today that C# does not support dynamic sized
Im trying to find out a good JavaScript library that can create a nice
Is there a way that I can find out how many matches of a
I am trying to find out if there are any relevant measurements that LoadRunner
Is there a way that i can find out what base tables are being
Is there a public/government web service that I can call to find out what
I'm reading about STL algorithms and the book pointed out that algorithms like find
I'm learning Scala and there is a thing that I can't find out about

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.