Bug 99481 - glsl_parser_extras.cpp:1253:18: error: expected ')' before 'PRId64'
Summary: glsl_parser_extras.cpp:1253:18: error: expected ')' before 'PRId64'
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
Depends on:
Blocks:
 
Reported: 2017-01-21 07:43 UTC by Vinson Lee
Modified: 2017-02-04 09:20 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2017-01-21 07:43:10 UTC
mesa: bb5db5564ffa5beeda19279c67fca5f623a36d03 (master 17.1.0-devel)

  CXX      glsl/glsl_parser_extras.lo
glsl/glsl_parser_extras.cpp: In member function 'virtual void ast_expression::print() const':
glsl/glsl_parser_extras.cpp:1253:18: error: expected ')' before 'PRId64'
       printf("%" PRId64 " ", primary_expression.int64_constant);
                  ^

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


commit bbce1c538dc0cb8bf3769510283d11847dc07540
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu Jun 9 09:39:48 2016 +1000

    glsl/ast/ir: Add 64-bit integer constant support
    
    This adds support for 64-bit integer constants to the parser,
    ast and ir.
    
    v2: fix a few issues found in testing.
    
    v3: Add missing ir_constant copy contructor support.
    
    v4: Use PRIu64 and PRId64 in printfs in glsl_parser_extras.cpp.
    Suggested by Nicolai.  Rebase on Marek's linalloc changes.
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
    Reviewed-by: Matt Turner <mattst88@gmail.com> [v3]
    Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Comment 1 Vinson Lee 2017-02-04 09:20:55 UTC
commit aceae09ef05dbe8540d8a2da6f784153deb9bbf6
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jan 23 20:21:00 2017 +0100

    glsl: fix compile errors with mingw due to missing PRIx64 definitions
    
    define __STDC_FORMAT_MACROS and include <inttypes.h> (same as
    ir_builder_print_visitor.cpp already does).
    
    Otherwise, some mingw build errors out (since
    8e7e1ae0365ddc7edb0d4d98250ab46728e6c14a and
    bbce1c538dc0cb8bf3769510283d11847dc07540 presumably) with:
    src/compiler/glsl/ir_print_visitor.cpp:479:40: error: expected ‘)’ before ‘PRIu64’
       case GLSL_TYPE_UINT64:fprintf(f, "%" PRIu64, ir->value.u64[i]); break;
    
    (Note even with that fix I get other format specifier warnings:
    src/compiler/glsl/ir_print_visitor.cpp:473:47:
    warning: unknown conversion type character ‘a’ in format [-Wformat=]
                    fprintf(f, "%a", ir->value.f[i]);
                                                   ^
    src/compiler/glsl/ir_print_visitor.cpp:473:47:
    warning: too many arguments for format [-Wformat-extra-args]
    but it still compiles at least)
    
    Reviewed-by: Jose Fonseca <jfonseca@vmware.com>


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.