Skip to content

Commit

Permalink
apacheGH-41020: [C++] Introduce portable compiler assumptions (apache…
Browse files Browse the repository at this point in the history
…#41021)

### Rationale for this change

Allow portable use of the "assumption" feature of modern GCC, Clang, and MSVC compilers.

### What changes are included in this PR?

 - Documenting of macros in `macros.h`
 - Addition of `ARROW_COMPILER_ASSUME`
 - One simple change where this macro simplifies the existing code while keeping the common case of a loop branch dependent only on local variables
 
### Are these changes tested?

By existing tests.
* GitHub Issue: apache#41020

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
  • Loading branch information
felipecrv authored and rok committed May 8, 2024
1 parent f3f337f commit 3f4c79d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion cpp/src/arrow/util/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
#define ARROW_ARG_UNUSED(x) x
#else
#define ARROW_ARG_UNUSED(x)
#endif
#if defined(__GNUC__) // GCC and compatible compilers (clang, Intel ICC)
#define ARROW_NORETURN __attribute__((noreturn))
#define ARROW_NOINLINE __attribute__((noinline))
Expand Down

0 comments on commit 3f4c79d

Please sign in to comment.