Bug 88335 - format_pack.c:9567:22: error: expected ')'
Summary: format_pack.c:9567:22: error: expected ')'
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) All
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2015-01-12 18:49 UTC by Vinson Lee
Modified: 2015-01-14 12:48 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch (1.19 KB, patch)
2015-01-13 10:10 UTC, Samuel Iglesias Gonsálvez
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Vinson Lee 2015-01-12 18:49:39 UTC
mesa: 0e6f0eea1aae95213b359662495142fc7b88c34f (master 10.5.0-devel)


Build error on FreeBSD.

  CC       format_pack.lo
../../src/mesa/main/format_pack.c:9567:22: error: expected ')'
    assert(*d >= 0.0 f);
                     ^
Comment 1 Vinson Lee 2015-01-12 19:35:19 UTC
Build is also broken on Mac OS X.

e0439f750557bc6880a8a4eccb38256fafd63fae is the first bad commit
commit e0439f750557bc6880a8a4eccb38256fafd63fae
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Thu Aug 21 12:38:05 2014 -0700

    mesa: Autogenerate most of format_pack.c
    
    We were auto-generating it before.  The problem was that the autogeneration
    tool we were using was called "copy, paste, and edit".  Let's use a more
    sensible solution.
    
    Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
    
    v2 by Samuel Iglesias <siglesias@igalia.com>
    - Remove format_pack.c as it is now autogenerated
    - Add usage of INDENT_FLAGS in Makefile.am
    - Remove trailing blank line
    
    v3 by Samuel Iglesias <siglesias@igalia.com>
    - Merge format_convert.py into format_parser.py
       - Adapt pack_*_* function generations
    - Fix out-of-tree build
    
    v4 by Samuel Iglesias <siglesias@igalia.com>
    - _get_datatype() is now a helper function
    
    v5 by Samuel Iglesias <siglesias@igalia.com>
    - format_pack.c.mako is now format_pack.py, with the template code
      inlined. It now auto-generates format_pack.c
    - Simplify Makefile.am change.
    - Modify SConscript to build format_pack.c with scons.
    - Remove run_mako.py
    - Add format_pack.c to gitignore
    
    v6 by Samuel Iglesias <siglesias@igalia.com>:
    - Don't allow float to non-normalized integer format conversions.
    - Add non-normalized formats support for ubyte packing functions. Merge
    the previously separated patch.
    - Add clamping for non-normalized integer formats in pack_ubyte*()
    
    v7 by Samuel Iglesias <siglesias@igalia.com>:
    - Add assert to check that sRGB formats are 8-bit size.
    
    Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
    Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>

:040000 040000 63515b5b815382ffdd60de088cf3fef8baf3d255 b0dffc189c7eb0fe800f4d11bac5cdde6de7e268 M	src
bisect run success
Comment 2 Matt Turner 2015-01-12 23:31:29 UTC
(In reply to Vinson Lee from comment #0)
> mesa: 0e6f0eea1aae95213b359662495142fc7b88c34f (master 10.5.0-devel)
> 
> 
> Build error on FreeBSD.
> 
>   CC       format_pack.lo
> ../../src/mesa/main/format_pack.c:9567:22: error: expected ')'
>     assert(*d >= 0.0 f);
>                      ^

Weird... I see

> assert(*d >= 0.0f);

in pack_uint_Z_FLOAT32() and pack_uint_Z_FLOAT32_X24S8(), but not with the extra space. Those functions are emitted as-is from the python script too...
Comment 3 Samuel Iglesias Gonsálvez 2015-01-13 09:22:03 UTC
I have access to a Mac OS X machine. The problem is not the output from Mako template but the "indent" command in Mac OS X (likely the same in FreeBSD) which is not the GNU one. That "indent" command is the responsible of adding those spaces.

I am going to do some tests and write a patch fixing it.

Thanks for your bug report!
Comment 4 Samuel Iglesias Gonsálvez 2015-01-13 10:10:32 UTC
Created attachment 112156 [details] [review]
Patch

I wrote a patch that fixes the issue for Mac OS X but I have not access to a FreeBSD machine.

Vinson, Can you apply the patch and tell me if it fixes the issue in FreeBSD too? Once you confirmed that, I will send it to the mailing list.

If you prefer to pull a branch, it is also available on top of today's master in my github repo:

https://github.com/samuelig/mesa/tree/fix-mac-os-x
Comment 5 Vinson Lee 2015-01-13 18:04:19 UTC
(In reply to Samuel Iglesias from comment #4)
> 
> Vinson, Can you apply the patch and tell me if it fixes the issue in FreeBSD
> too? Once you confirmed that, I will send it to the mailing list.
> 

attachment 112156 [details] [review] fixes the build on FreeBSD.

Tested-by: Vinson Lee <vlee@freedesktop.org>
Comment 6 Samuel Iglesias Gonsálvez 2015-01-14 07:16:45 UTC
Patch sent to the mailing list:

http://lists.freedesktop.org/archives/mesa-dev/2015-January/074367.html
Comment 7 Samuel Iglesias Gonsálvez 2015-01-14 12:48:38 UTC
Pushed patch to master branch.


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.