From a0709949ddb69e5e28d79f7898c37ebf281696b0 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@38d2e660-2303-0410-9eaa-f027e97ec537> Date: Thu, 20 Aug 2009 14:38:38 +0000 Subject: [PATCH] Trick to silent compiler warning. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2775 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/compiler.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bertos/cfg/compiler.h b/bertos/cfg/compiler.h index 7357f43f..87cdd942 100644 --- a/bertos/cfg/compiler.h +++ b/bertos/cfg/compiler.h @@ -500,12 +500,12 @@ typedef unsigned char page_t; /**< Type for banked memory pages. */ */ #if COMPILER_TYPEOF && COMPILER_STATEMENT_EXPRESSIONS #define containerof(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *_mptr = (ptr); /* type check */ \ - (type *)((char *)_mptr - offsetof(type, member)); \ + typeof( ((type *)0)->member ) *_mptr = (ptr); /* type check */ \ + (type *)(void *)((char *)_mptr - offsetof(type, member)); \ }) #else #define containerof(ptr, type, member) \ - ( (type *)((char *)(ptr) - offsetof(type, member)) ) + ( (type *)(void *)((char *)(ptr) - offsetof(type, member)) ) #endif /** Issue a compilation error if the \a condition is false */ -- 2.25.1