Skip to content

Commit ad8baf6

Browse files
committed
Omit semicolons after _Pragma directives
These are not statements and shouldn't be terminated by semicolons; in newer versions of Clang separating these by semicolons results in a build error. We can also further simplify `remove_volatile_cast` by using the comma operator and avoiding the reliance on non-standard GNU extensions.
1 parent a76f241 commit ad8baf6

File tree

1 file changed

+2
-2
lines changed
  • src/rp2_common/hardware_sync/include/hardware

1 file changed

+2
-2
lines changed

src/rp2_common/hardware_sync/include/hardware/sync.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ bool spin_lock_is_claimed(uint lock_num);
372372
#define remove_volatile_cast(t, x) (t)(x)
373373
#define remove_volatile_cast_no_barrier(t, x) (t)(x)
374374
#else
375-
#define remove_volatile_cast(t, x) ({__compiler_memory_barrier(); Clang_Pragma("clang diagnostic push"); Clang_Pragma("clang diagnostic ignored \"-Wcast-qual\""); (t)(x); Clang_Pragma("clang diagnostic pop"); })
376-
#define remove_volatile_cast_no_barrier(t, x) ({ Clang_Pragma("clang diagnostic push"); Clang_Pragma("clang diagnostic ignored \"-Wcast-qual\""); (t)(x); Clang_Pragma("clang diagnostic pop"); })
375+
#define remove_volatile_cast(t, x) (__compiler_memory_barrier(), Clang_Pragma("clang diagnostic push") Clang_Pragma("clang diagnostic ignored \"-Wcast-qual\"") (t)(x) Clang_Pragma("clang diagnostic pop"))
376+
#define remove_volatile_cast_no_barrier(t, x) Clang_Pragma("clang diagnostic push") Clang_Pragma("clang diagnostic ignored \"-Wcast-qual\"") (t)(x) Clang_Pragma("clang diagnostic pop")
377377
#endif
378378

379379
#ifdef __cplusplus

0 commit comments

Comments
 (0)