From: navarrop Date: Tue, 6 Jul 2010 14:06:50 +0000 (+0000) Subject: [From Arnaud Giersch] In standard C, we are allowed to initialize a variable with... X-Git-Tag: v3_5~839 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d6ec268a0c0a50991c7b59bdcc253e296bea62b8?ds=sidebyside [From Arnaud Giersch] In standard C, we are allowed to initialize a variable with "a pointer to an lvalue designating an object of static storage duration" (seeISO/IEC 9899_1999, Section 6.6). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7978 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/log.h b/include/xbt/log.h index 5bba6f6915..1032716abf 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -92,10 +92,12 @@ SG_BEGIN_DECL() /* The root of the category hierarchy. */ #define XBT_LOG_ROOT_CAT root -/* In strict ansi C, we are not allowed to initialize a variable with - * a non-constant value. But the whole tree of categories is - * connected by setting the address of the parent category as a field - * of the child one. +/* The whole tree of categories is connected by setting the address of + * the parent category as a field of the child one. + * + * In strict ansi C, we are allowed to initialize a variable with "a + * pointer to an lvalue designating an object of static storage + * duration" [ISO/IEC 9899:1999, Section 6.6]. * * Unfortunately, Visual C builder does not target any standard * compliance, and C99 is not an exception to this unfortunate rule. @@ -110,7 +112,7 @@ SG_BEGIN_DECL() * you don't want to see your child category become a child of root * directly. */ -#if defined(__STRICT_ANSI__) || defined(_MSC_VER) +#if defined(_MSC_VER) # define _XBT_LOG_PARENT_INITIALIZER(parent) NULL # define XBT_LOG_CONNECT(parent_cat,child) _XBT_LOGV(child).parent = &_XBT_LOGV(parent_cat) #else