Bug 198447 - Fix graphics/blender build with clang 3.6.0
Summary: Fix graphics/blender build with clang 3.6.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Marcus von Appen
URL:
Keywords:
Depends on:
Blocks: 197395
  Show dependency treegraph
 
Reported: 2015-03-09 07:58 UTC by Dimitry Andric
Modified: 2015-09-08 20:52 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (mva)


Attachments
Work around array problems in Blender's usage of _Generic (2.74 KB, patch)
2015-03-09 07:58 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2015-03-09 07:58:20 UTC
Created attachment 154046 [details]
Work around array problems in Blender's usage of _Generic

During the exp-run in bug 197395, it was found that graphics/blender gives errors with clang 3.6.0:

http://package18.nyi.freebsd.org/data/headamd64PR197395-default/2015-02-11_23h04m51s/logs/errors/blender-2.73a.log

These errors are because blender attempts some interesting (or horrible, depending on your POV :) tricks with _Generic support, and apparently these fail when used on array types.  To fix this, I have applied the equally interesting/horrible workaround from here:

http://stackoverflow.com/questions/18857056/c11-generic-how-to-deal-with-string-literals
Comment 1 Marcus von Appen freebsd_committer freebsd_triage 2015-03-20 21:57:23 UTC
Does that fix still compile cleanly on older clang versions and GCC?
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2015-03-20 22:59:22 UTC
(In reply to Marcus von Appen from comment #1)
This patch only changes behavior for compilers that default to C11, e.g. clang 3.6.0 or higher.  For gcc, which defaults to "gnu89", and earlier versions of clang, which default to "gnu99", there should be no difference.

That is, unless the port somehow manually enables -std=c11 somewhere during its configure phase?  I can't recall whether that is the case.

I currently do not have the resources to test this myself.
Comment 3 Marcus von Appen freebsd_committer freebsd_triage 2015-04-08 16:21:40 UTC
Is this still relevant for the recent 2.74 update to graphics/blender?
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2015-04-08 17:31:44 UTC
As far as I can see, upstream blender has still not fixed this, so yes, this patch still needs to be applied.
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2015-09-08 20:52:00 UTC
Close:  graphics/blender builds find with clang 3.6.0 since the update to version 2.74