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

Fails to build due to illegal conversion between _Complex double and float #3

Closed
marcusmueller opened this issue Dec 19, 2021 · 2 comments

Comments

@marcusmueller
Copy link
Contributor

marcusmueller commented Dec 19, 2021

using F34, cmake 3.20.5, clang 12.0.1 to build 878c4f7 against GNU Radio v3.9.4.0-40-g823f73013 :

FAILED: lib/CMakeFiles/gnuradio-dvbs2rx.dir/pl_freq_sync.cc.o
ccache /usr/bin/clang++ -DGR_MPLIB_GMP -Dgnuradio_dvbs2rx_EXPORTS -I../lib/../include -isystem /home/marcus/usrlocal-3.9/include -isystem /usr/include/python3.9 -march=native -Wall -O2 -g -DNDEBUG -fPIC   -fvisibility=hidden -std=gnu++17 -MD -MT lib/CMakeFiles/gnuradio-dvbs2rx.dir/pl_freq_sync.cc.o -MF lib/CMakeFiles/gnuradio-dvbs2rx.dir/pl_freq_sync.cc.o.d -o lib/CMakeFiles/gnuradio-dvbs2rx.dir/pl_freq_sync.cc.o -c ../lib/pl_freq_sync.cc
../lib/pl_freq_sync.cc:88:37: error: implicit conversion from '_Complex double' to 'float' is not permitted in C++
        unmod_pilots[i] = (+SQRT2_2 - SQRT2_2i);
                        ~  ~~~~~~~~~^~~~~~~~~~
1 error generated.
@marcusmueller
Copy link
Contributor Author

everywhere like here, where it's clear the target type is gr_complex==std::complex<float>, you could do things like

unmod_pilots[i] = {+SQRT2_2, -SQRT2_2};

instead, to call the std::complex constructor via initialization list.

But this is done in a lot of places, and I'm not sure that trick works everywhere.

@igorauad
Copy link
Owner

igorauad commented Jan 5, 2022

Your solution in 8ee89fd has been merged to master already. Many thanks!

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

2 participants