Bug 29571

Summary: [glsl2] glcpp/glcpp-parse.y(312) : error C2146: syntax error : missing ')' before identifier 'PRIiMAX'
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: mesa-dev
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: medium CC: brianp, idr, jakob, jfonseca
Version: git   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2010-08-13 18:56:23 UTC
mesa: 8f8cdbfba43550d0b8985fb087961864e4cd92b6 (glsl2)

Build with MSVC.

$ scons quiet=no
...
scons: building associated VariantDir targets: build\windows-x86-debug
cl /Fobuild\windows-x86-debug\glsl\glcpp\glcpp-parse.obj /c src\glsl\glcpp\glcpp-parse.c /nologo /Od /Oi /Oy- /GL- /fp:fast /W3 /MTd /LDd /DDEBUG /DWIN32 /D_WINDOWS /D_WIN32_WINNT=0x0601 /DWINVER=0x0601 /DVC_EXTRALEAN /D_USE_MATH_DEFINES /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_DEPRECATE /D_DEBUG /DPIPE_SUBSYSTEM_WINDOWS_USER /Isrc\talloc /Isrc\mapi /Isrc\mesa /Iinclude /Isrc\gallium\include /Isrc\gallium\auxiliary /Isrc\gallium\drivers /Isrc\gallium\winsys /Iinclude\c99 /Z7
glcpp-parse.c
glcpp/glcpp-parse.y(201) : warning C4244: 'function' : conversion from 'intmax_t' to 'int', possible loss of data
glcpp/glcpp-parse.y(204) : warning C4244: 'function' : conversion from 'intmax_t' to 'int', possible loss of data
glcpp/glcpp-parse.y(311) : warning C4244: 'function' : conversion from 'intmax_t' to 'int', possible loss of data
glcpp/glcpp-parse.y(312) : error C2146: syntax error : missing ')' before identifier 'PRIiMAX'
glcpp/glcpp-parse.y(320) : warning C4013: 'strtoll' undefined; assuming extern returning int
glcpp/glcpp-parse.y(492) : warning C4244: 'function' : conversion from 'intmax_t' to 'int', possible loss of data
glcpp/glcpp-parse.y(492) : warning C4244: 'function' : conversion from 'intmax_t' to 'int', possible loss of data
glcpp/glcpp-parse.y(541) : error C2143: syntax error : missing '{' before '*'
glcpp/glcpp-parse.y(543) : error C2371: '_string_list_create' : redefinition; different basic types
        glcpp/glcpp-parse.y(55) : see declaration of '_string_list_create'
glcpp/glcpp-parse.y(550) : warning C4133: 'return' : incompatible types - from 'string_list_t *' to 'int *'
glcpp/glcpp-parse.y(794) : error C2146: syntax error : missing ')' before identifier 'PRIiMAX'
glcpp/glcpp-parse.y(794) : error C2059: syntax error : ')'
scons: *** [build\windows-x86-debug\glsl\glcpp\glcpp-parse.obj] Error 2
scons: building terminated because of errors.


src/glsl/glcpp/glcpp-parse.y
   312                  glcpp_printf(parser->output, "#version %" PRIiMAX "\n", $2);
Comment 1 Ian Romanick 2010-08-13 19:02:38 UTC
This is why stdint.h isn't good enough.  inttypes.h defines the macros for printf format strings.  I repeat my recommendation that the very high quality implementation of inttypes.h and stdint.h that is hosted on Google Code be put in an external SDK that is used to build Mesa on Windows.

http://code.google.com/p/msinttypes/
Comment 2 Jose Fonseca 2010-08-14 08:06:31 UTC
Fixed with 

commit 8df0bea9c58e983ded6819914c532edf52737cb7
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat Aug 14 16:00:52 2010 +0100

    Replace our custom C99 headers with http://code.google.com/p/msinttypes/
    
    Perhaps http://www.azillionmonkeys.com/qed/pstdint.h would be a better
    (more portable) choice, but only MSVC uses this anyway, and we can always
    change later.


commit 9349379d1acca23e7a2442549e49e9b58515d731
Author: José Fonseca <jfonseca@vmware.com>
Date:   Sat Aug 14 16:01:24 2010 +0100

    Revert "glsl2: Use stdint.h instead of inttypes.h"
    
    This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
Comment 3 Vinson Lee 2010-08-15 13:44:04 UTC
mesa: a0b0afc6944b00df27145a96ad2727a36752e1d6 (glsl2)

Verified fixed.

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.