Skip to content

Commit 95db973

Browse files
markdrothcopybara-github
authored andcommitted
Fix unused parameter warnings.
PiperOrigin-RevId: 850183045
1 parent acffab7 commit 95db973

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

upb/port/sanitizers.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ UPB_INLINE uint8_t _upb_Xsan_NextTag(upb_Xsan *xsan) {
4141
}
4242
return xsan->state;
4343
#else
44+
UPB_UNUSED(xsan);
4445
return 0;
4546
#endif
4647
}
@@ -57,13 +58,16 @@ UPB_INLINE uint8_t UPB_PRIVATE(_upb_Xsan_GetTag)(const void *addr) {
5758
#if UPB_HWASAN
5859
return __hwasan_get_tag_from_pointer(addr);
5960
#else
61+
UPB_UNUSED(addr);
6062
return 0;
6163
#endif
6264
}
6365

6466
UPB_INLINE void UPB_PRIVATE(upb_Xsan_Init)(upb_Xsan *xsan) {
6567
#if UPB_HWASAN || UPB_TSAN
6668
xsan->state = 0;
69+
#else
70+
UPB_UNUSED(xsan);
6771
#endif
6872
}
6973

@@ -72,6 +76,9 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_MarkInitialized)(void* addr, size_t size) {
7276
if (size) {
7377
__msan_unpoison(addr, size);
7478
}
79+
#else
80+
UPB_UNUSED(addr);
81+
UPB_UNUSED(size);
7582
#endif
7683
}
7784

@@ -84,6 +91,9 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_PoisonRegion)(const void *addr,
8491
__asan_poison_memory_region(addr, size);
8592
#elif UPB_HWASAN
8693
__hwasan_tag_memory(addr, UPB_HWASAN_POISON_TAG, UPB_ALIGN_MALLOC(size));
94+
#else
95+
UPB_UNUSED(addr);
96+
UPB_UNUSED(size);
8797
#endif
8898
}
8999

@@ -161,13 +171,17 @@ UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadOnly)(upb_Xsan *xsan) {
161171
#if UPB_TSAN
162172
// For performance we avoid using a volatile variable.
163173
__asm__ volatile("" ::"r"(xsan->state));
174+
#else
175+
UPB_UNUSED(xsan);
164176
#endif
165177
}
166178

167179
UPB_INLINE void UPB_PRIVATE(upb_Xsan_AccessReadWrite)(upb_Xsan *xsan) {
168180
#if UPB_TSAN
169181
// For performance we avoid using a volatile variable.
170182
__asm__ volatile("" : "+r"(xsan->state));
183+
#else
184+
UPB_UNUSED(xsan);
171185
#endif
172186
}
173187

0 commit comments

Comments
 (0)