From: (no author) <(no author)@38d2e660-2303-0410-9eaa-f027e97ec537> Date: Thu, 20 Aug 2009 14:38:38 +0000 (+0000) Subject: Trick to silent compiler warning. X-Git-Tag: 2.2.0~193 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=a0709949ddb69e5e28d79f7898c37ebf281696b0;p=bertos.git Trick to silent compiler warning. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2775 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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 */