Bug 97952 - /usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration
Summary: /usr/include/string.h:518:12: error: exception specification in declaration d...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: bisected, regression
: 98042 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-27 16:49 UTC by Vinson Lee
Modified: 2016-10-20 23:53 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vinson Lee 2016-09-27 16:49:00 UTC
mesa: 4421c0fb0dc7a51c3d639c452ad8a5d55a99cec1 (master 12.1.0-devel)

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
           ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
#define ffs __builtin_ffs
            ^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
                 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
#define ffs __builtin_ffs
            ^

ecd6fce2611e88ff8468a354cff8eda39f260a31 is the first bad commit
commit ecd6fce2611e88ff8468a354cff8eda39f260a31
Author: Rob Clark <robdclark@gmail.com>
Date:   Wed Aug 31 17:44:01 2016 -0400

    mesa/st: support lowering multi-planar YUV
    
    Support multi-planar YUV for external EGLImage's (currently just in the
    dma-buf import path) by lowering to multiple texture fetch's for each
    plane and CSC in shader.
    
    There was some discussion of alternative approaches for tracking the
    additional UV or U/V planes:
    
      https://lists.freedesktop.org/archives/mesa-dev/2016-September/127832.html
    
    They all seemed worse than pipe_resource::next
    
    Signed-off-by: Rob Clark <robdclark@gmail.com>

:040000 040000 80840dcad2d468df7741746515b03247c41a1084 88f03e54885c7b5b1090fb09709e7daf66972941 M	src
bisect run success
Comment 1 Vinson Lee 2016-10-04 18:01:55 UTC
*** Bug 98042 has been marked as a duplicate of this bug. ***
Comment 2 Rob Clark 2016-10-04 19:22:50 UTC
/me shrugs..

I don't really have a setup for building with clang..  I guess the issue is introduction of #include "bitscan.h" in mtypes.h.  Although bitscan.h was already used elsewhere, so not entirely sure why it worked before if this is breaking things.  I guess something that someone who has a setup to build w/ clang will have to debug.
Comment 3 Timothy Arceri 2016-10-04 22:51:01 UTC
I believe its because the ffs param in string.h is an int while the one in bitscan.h is unsigned.
Comment 4 Rob Clark 2016-10-06 17:27:21 UTC
(In reply to Timothy Arceri from comment #3)
> I believe its because the ffs param in string.h is an int while the one in
> bitscan.h is unsigned.

oh, yeah, probably should be int in bitscan.h then

(still not entirely sure why this issue starts showing up now, but I guess it comes down to #include order and luck before)
Comment 5 Timothy Arceri 2016-10-20 23:53:20 UTC
Fixed by:

author	Vinson Lee <vlee@freedesktop.org>
commit	889ee4da05400687a6c5296a7632dc26f1d61924

util: Include string.h in bitscan.h.

Fix build error with clang.

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
           ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
                 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97952
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>


bug/show.html.tmpl processed on Mar 30, 2017 at 08:53:38.
(provided by the Example extension).