You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "SahilKang (via GitHub)" <gi...@apache.org> on 2024/03/10 22:46:34 UTC

[PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

SahilKang opened a new pull request, #2797:
URL: https://github.com/apache/avro/pull/2797

   ## What is the purpose of the change
   
   macOS 10.12 deprecated the OSAtomic* functions. This removes the following warnings:
   
   ```
     warning: 'OSAtomicIncrement32' is deprecated: first deprecated in macOS 10.12
     warning: 'OSAtomicDecrement32' is deprecated: first deprecated in macOS 10.12
   ```
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as `make test`
   
   ## Documentation
   
   No new features are added


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

Posted by "mkmkme (via GitHub)" <gi...@apache.org>.
mkmkme commented on PR #2797:
URL: https://github.com/apache/avro/pull/2797#issuecomment-1990917287

   I see. Thanks for the clarification!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

Posted by "mkmkme (via GitHub)" <gi...@apache.org>.
mkmkme commented on PR #2797:
URL: https://github.com/apache/avro/pull/2797#issuecomment-1987986242

   Wouldn't it be better to introduce a new branch for newer version of macOS with usage of `atomic_fetch_sub_explicit(memory_order_relaxed)` and `atomic_fetch_add_explicit(memory_order_relaxed)`, as suggested by the compiler warning?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g merged PR #2797:
URL: https://github.com/apache/avro/pull/2797


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g commented on PR #2797:
URL: https://github.com/apache/avro/pull/2797#issuecomment-1990969777

   Thank you, @SahilKang and @mkmkme !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] AVRO-3959: [C] Avoid deprecated OSX atomic ops [avro]

Posted by "SahilKang (via GitHub)" <gi...@apache.org>.
SahilKang commented on PR #2797:
URL: https://github.com/apache/avro/pull/2797#issuecomment-1990257647

   using the c11 atomic ops would require changing the `volatile int` input to `atomic_int`...and that'd require changing `volatile int` in several places
   
   to maintain backwards compatibility with the pre-c11 branches, we'd have to use preprocessor wrappers at a higher level
   
   something like:
   ```
   #ifdef __IS_C_11__
   #define ATOMIC_INT atomic_int
   #define ATOMIC_INC(x) atomic_fetch_add_explicit(x)
   ...
   #else
   #define ATOMIC_INT volatile int
   #define ATOMIC_INC(x) __sync_add_and_fetch(x, 1)
   ...
   #endif
   ```
   
   fwiw, I think that'd be a nice followup change to standardize things a bit more


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org