public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH liburing] sanitize: add ifdef guard around sanitizer functions
@ 2024-10-03  0:02 David Wei
  2024-10-03  0:45 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: David Wei @ 2024-10-03  0:02 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, Pavel Begunkov, David Wei

Otherwise there are redefinition errors during compilation if
CONFIG_USE_SANITIZER isn't set.

Signed-off-by: David Wei <dw@davidwei.uk>
---
 src/sanitize.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/sanitize.c b/src/sanitize.c
index 46391a6..db5930d 100644
--- a/src/sanitize.c
+++ b/src/sanitize.c
@@ -118,6 +118,7 @@ static inline void initialize_sanitize_handlers()
 	sanitize_handlers_initialized = true;
 }
 
+#if defined(CONFIG_USE_SANITIZER)
 void liburing_sanitize_ring(struct io_uring *ring)
 {
 	struct io_uring_sq *sq = &ring->sq;
@@ -174,3 +175,4 @@ void liburing_sanitize_iovecs(const struct iovec *iovecs, unsigned nr)
 		}
 	}
 }
+#endif
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH liburing] sanitize: add ifdef guard around sanitizer functions
  2024-10-03  0:02 [PATCH liburing] sanitize: add ifdef guard around sanitizer functions David Wei
@ 2024-10-03  0:45 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2024-10-03  0:45 UTC (permalink / raw)
  To: David Wei, io-uring; +Cc: Pavel Begunkov

On 10/2/24 6:02 PM, David Wei wrote:
> Otherwise there are redefinition errors during compilation if
> CONFIG_USE_SANITIZER isn't set.
> 
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
>  src/sanitize.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/sanitize.c b/src/sanitize.c
> index 46391a6..db5930d 100644
> --- a/src/sanitize.c
> +++ b/src/sanitize.c
> @@ -118,6 +118,7 @@ static inline void initialize_sanitize_handlers()
>  	sanitize_handlers_initialized = true;
>  }
>  
> +#if defined(CONFIG_USE_SANITIZER)
>  void liburing_sanitize_ring(struct io_uring *ring)
>  {
>  	struct io_uring_sq *sq = &ring->sq;
> @@ -174,3 +175,4 @@ void liburing_sanitize_iovecs(const struct iovec *iovecs, unsigned nr)
>  		}
>  	}
>  }
> +#endif

Hmm, but src/sanitize.o should not be built unless that is set. How is
this happening?

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-03  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-03  0:02 [PATCH liburing] sanitize: add ifdef guard around sanitizer functions David Wei
2024-10-03  0:45 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox