Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcode10 vst2 building: 1 warning, one error #201

Closed
esaruoho opened this issue Jan 4, 2019 · 9 comments
Closed

xcode10 vst2 building: 1 warning, one error #201

esaruoho opened this issue Jan 4, 2019 · 9 comments

Comments

@esaruoho
Copy link
Collaborator

esaruoho commented Jan 4, 2019

getting these errors on a secondary macos mojave machine:

CompileC /Users/esaruoho/work/surge/obj/x64/Release/surge-vst2/surge-vst2.build/Objects-normal/x86_64/audioeffectx.o /Users/esaruoho/work/VST2.4SDK/public.sdk/source/vst2.x/audioeffectx.cpp nor$
    cd /Users/esaruoho/work/surge
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-l$
/Users/esaruoho/work/VST2.4SDK/public.sdk/source/vst2.x/audioeffectx.cpp:307:48: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
        if (cEffect.flags & effFlagsIsSynth || canDo ("receiveVstMidiEvent") == 1)
                                                      ^
1 warning generated.

CompileC /Users/esaruoho/work/surge/obj/x64/Release/surge-vst2/surge-vst2.build/Objects-normal/x86_64/audioeffect.o /Users/esaruoho/work/VST2.4SDK/public.sdk/source/vst2.x/audioeffect.cpp norma$
    cd /Users/esaruoho/work/surge
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-l$
/Users/esaruoho/work/VST2.4SDK/public.sdk/source/vst2.x/audioeffect.cpp:512:20: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowin$
                        char temp[2] = {'0' + (char)digit, '\0'};
                                        ^~~~~~~~~~~~~~~~~
/Users/esaruoho/work/VST2.4SDK/public.sdk/source/vst2.x/audioeffect.cpp:512:20: note: insert an explicit cast to silence this issue
                        char temp[2] = {'0' + (char)digit, '\0'};
                                        ^~~~~~~~~~~~~~~~~
                                        static_cast<char>( )
1 error generated.

what am i doing wrong? the vst2.4sdk is what it should always be.

@baconpaul
Copy link
Collaborator

baconpaul commented Jan 4, 2019

That bit of code has always been a bit dubious. We've seen it before.

I note that if I take a simple version of that

paul:~/dev/Learn$ cat x.cpp

int main( int argc, char **argv )
{
	int d = 1;
	char tmp[2] = {'0' + (char)d, '\0'};
}

I get flag dependent behavior out of clang

paul:~/dev/Learn$ clang -c x.cpp
paul:~/dev/Learn$ clang -c -std=c++17 x.cpp
x.cpp:5:17: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
        char tmp[2] = {'0' + (char)d, '\0'};
                       ^~~~~~~~~~~~~
x.cpp:5:17: note: insert an explicit cast to silence this issue
        char tmp[2] = {'0' + (char)d, '\0'};
                       ^~~~~~~~~~~~~
                       static_cast<char>( )
1 error generated.
paul:~/dev/Learn$ clang -c -Wno-c++11-narrowing -std=c++17 x.cpp
paul:~/dev/Learn$ clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Like I've said a bunch of times now, I don't have the VST2 sdk so can't repro.

@esaruoho
Copy link
Collaborator Author

esaruoho commented Jan 5, 2019

@baconpaul i found a place that has the vst2sdk. are you interested in checking it out?

@baconpaul
Copy link
Collaborator

I'm good thanks. I had to figure it out to fix the wave shaper in vst2 the other day.

@esaruoho
Copy link
Collaborator Author

esaruoho commented Jan 8, 2019

what's really weird is that on one computer (same OS, same computer, same setup?!), vst2 rolls without issues, on another, vst2 doesn't roll. i don't get it at all.

@baconpaul
Copy link
Collaborator

Sure the Xcode versions are the same? Also can we close the issue since it doesn’t seem like There is anything we can do?

@esaruoho
Copy link
Collaborator Author

esaruoho commented Jan 8, 2019

i'm gonna close this since this is my own environment's fault :)

@jucor
Copy link

jucor commented Dec 15, 2021

@baconpaul Were you ever able to compile the VST2 sdk and make that narrowing error go away, please? It's biting us in werman/noise-suppression-for-voice#101 . Any help appreciated!

@baconpaul
Copy link
Collaborator

as you know the vst2 sdk is no longer licensed, and you can't get a copy, so who knows what the problem is etc...

but also

  char temp[2] = {static_cast<char>('0' + (char)digit), '\0'};

works just fine :)

@jucor
Copy link

jucor commented Dec 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants