<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7001</bug_id>
          
          <creation_ts>2014-11-26 19:30:37 +0000</creation_ts>
          <short_desc>Inconsistent use of #if XXX vs. #ifdef XXX</short_desc>
          <delta_ts>2014-12-10 16:10:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Juro Bystricky">juro.bystricky</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47217</commentid>
    <comment_count>0</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2014-11-26 19:30:37 +0000</bug_when>
    <thetext>eglibc-use-option-groups.patch contains &quot;#if __OPTION_EGLIBC_BIG_MACROS&quot; in several files. This will generate a compiler warning such as:

../sysdeps/nptl/bits/libc-lock.h:98:6: warning: &quot;__OPTION_EGLIBC_BIG_MACROS&quot; is not defined [-Wundef]
 # if __OPTION_EGLIBC_BIG_MACROS != 1
      ^

The warning is issued in spite of &lt;gnu/option-groups.h&gt; being included. 
This is currently a compiler warning, but glibc warnings are planned to be treated as errors in the future.

This is only evident in case where __OPTION_EGLIBC_BIG_MACROS is not defined 
in &lt;gnu/option-groups.h&gt;, for example poky-tiny.

The fix would be to use #ifdef (#ifndef) __OPTION_EGLIBC_BIG_MACROS instead of
#if  __OPTION_EGLIBC_BIG_MACROS. In this case, we would also need to (manually) make sure that the file &lt;gnu/option-groups&gt; is included.

Alternatively, the file &lt;gnu/option-groups.h&gt; could contain

#define __OPTION_EGLIBC_BIG_MACROS 0

instead of simply not defining __OPTION_EGLIBC_BIG_MACROS at all.
The advantage would be that we don&apos;t have to check (manually) for the file &lt;gnu/option-groups.h&gt; being included, we would get the above warning again if not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47241</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2014-11-27 18:48:45 +0000</bug_when>
    <thetext>I submitted a patch to openembedded-core@lists.openembedded.org.

The fix consists of modified option-groups.h generation, where now
each option is defined as 1 if enabled or 0 otherwise. This fixes warnings for all disabled options, not just _OPTION_EGLIBC_BIG_MACROS reported in this bug report.

With this change we cannot use #ifdef __OPTION_XXX anymore, instead we 
have to use #if _OPTION_XXX. In most cases #if _OPTION_XXX was already used
(and hence generated the compiler warnings), so only a few #ifdefs had
to be converted into #ifs.

After this fix if we see a warning &quot;OPTION_XXX&quot; is not defined, it truly
means an error. The previous behaviour was not deterministic (either the 
option was not defined because it was not enabled or the file option-groups.h
was not included)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47483</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2014-12-10 16:10:18 +0000</bug_when>
    <thetext>Patched merged SHA1 ID: 9fc63c57a82661a65ace3ebccdb535fe33de70f5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>