Re: Need help to build new version of ispc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 7, 2018 at 11:07 AM Luya Tshimbalanga
<luya@xxxxxxxxxxxxxxxxx> wrote:
> Getting the snapshot of ispc to support llvm 7.0 and needed by embree, it looks like the build broke at the following line:
>
> rc/main.cpp: In function 'int main(int, char**)':
> src/main.cpp:669:19: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
>              flags |= Module::GeneratePIC;
>              ~~~~~~^~~~~~~~~
> src/main.cpp:685:17: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
>            flags |= Module::GenerateFlatDeps;
>            ~~~~~~^~~~~~~~~
> src/main.cpp:688:62: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
>            flags |= Module::GenerateMakeRuleForDeps | Module::OutputDepsToStdout;
>                                                               ^~~~~~~~~~~~~~~~~~
> src/main.cpp:773:13: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
>        flags &= ~Module::OutputDepsToStdout;
>        ~~~~~~^~~~~~~~~~
> src/main.cpp:787:13: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
>        flags &= Module::GenerateMakeRuleForDeps;
>        ~~~~~~^~~~~~~~~

The problem is that enumerated types are supposed to be used as such,
not as bits in an integer, which is what this code is trying to do.
In order to compute the bitwise or, the enum elements have to be
converted to ints.  Then when the assignment part is to be done,
you've got an int that needs to be assigned to a variable of enum
type.  That's what the error message is complaining about.  The
simplest fix for you, the packager, is to add -fpermissive to the
build flags.

The best approach for upstream to take is to convert GeneratePIC, etc.
from elements of an enum to #define constants.

The most hideous approach for upstream to take is to convert the lines
in the error message to this form:

flags = static_cast<Module::OutputFlags>(flags | Module::GeneratePIC);

I absolutely do not recommend doing that.  If you don't want to build
with -fpermissive for some reason, then you could also patch the code
to look like that.  Again, not recommended.
-- 
Jerry James
http://www.jamezone.org/
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux