Bug 70331 - u_math.h:167:15: error: ‘long int lrint(double)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
Summary: u_math.h:167:15: error: ‘long int lrint(double)’ was declared ‘extern’ and la...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-10-10 00:53 UTC by Vinson Lee
Modified: 2013-10-10 20:51 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-10-10 00:53:38 UTC
mesa: 15e05b999b779dc48a8e768184b9c69e859c203b (master)

$ scons platform=windows toolchain=crossmingw
[...]
  Compiling src/mesa/state_tracker/st_glsl_to_tgsi.cpp ...
In file included from src/mesa/state_tracker/st_glsl_to_tgsi.cpp:63:0:
src/gallium/auxiliary/util/u_math.h: In function ‘long int lrint(double)’:
src/gallium/auxiliary/util/u_math.h:167:15: error: ‘long int lrint(double)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/math.h:654:21: error: previous declaration of ‘long int lrint(double)’ [-fpermissive]
src/gallium/auxiliary/util/u_math.h: In function ‘long int lrintf(float)’:
src/gallium/auxiliary/util/u_math.h:180:15: error: ‘long int lrintf(float)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/math.h:655:21: error: previous declaration of ‘long int lrintf(float)’ [-fpermissive]
src/gallium/auxiliary/util/u_math.h: In function ‘long long int llrint(double)’:
src/gallium/auxiliary/util/u_math.h:193:16: error: ‘long long int llrint(double)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/math.h:658:37: error: previous declaration of ‘long long int llrint(double)’ [-fpermissive]
src/gallium/auxiliary/util/u_math.h: In function ‘long long int llrintf(float)’:
src/gallium/auxiliary/util/u_math.h:206:16: error: ‘long long int llrintf(float)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/math.h:659:37: error: previous declaration of ‘long long int llrintf(float)’ [-fpermissive]


dbc1f3677c1deb32358a6a53f0ad3638a78c7c4f is the first bad commit
commit dbc1f3677c1deb32358a6a53f0ad3638a78c7c4f
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Oct 7 17:09:46 2013 -0700

    util/u_math: Fix C++ include of u_math.h on MSVC.
    
    GNU C++ compiler declares the C99 lrint, etc. when _GNU_SOURCE is
    defined, but MSVC does not.
    
    Trivial.

:040000 040000 da13b40708ba91b0050b59ab1fd77696e9067cad 131678637b3382080f97e1c9f188723a23f5ec59 M	src
bisect run success
Comment 1 Jose Fonseca 2013-10-10 20:51:53 UTC
Thanks Vinson. This should have been fixed with

commit a922d3413f99ec384ed23324a4cceade8ab57e34
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Oct 9 21:17:53 2013 -0700

    util: Fix MinGW build.
    
    _GNU_SOURCE appears to not be used reliably.  Use _MSC_VER instead so
    that MSVC alone is affected.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.