From 38c75f863a50c5d5e9b715f4edcc00ccc9aa37f4 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 24 Jun 2024 22:24:41 +0300 Subject: libcamera: base: log: Declare log categories when defining them libcamera will enable -Wmissing-declarations to catch mismatches between function declarations and definitions. There is one offender in log.h: when a category is defined with LOG_DEFINE_CATEGORY(), it generates a function with no declaration. Fix it by declaring the function using LOG_DECLARE_CATEGORY() as the first step of the category definition. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/base/log.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index b5775e49..df27df03 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -48,6 +48,7 @@ private: extern const LogCategory &_LOG_CATEGORY(name)(); #define LOG_DEFINE_CATEGORY(name) \ +LOG_DECLARE_CATEGORY(name) \ const LogCategory &_LOG_CATEGORY(name)() \ { \ /* The instance will be deleted by the Logger destructor. */ \ -- cgit v1.2.1