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

void bit_fill_hex(const char* str) failing when using clang compiler #4

Open
YenZi opened this issue Nov 16, 2018 · 0 comments
Open

Comments

@YenZi
Copy link

YenZi commented Nov 16, 2018

When trying to compile my code on macOS, using clang compiler, I get the following error :

ac_types-stable/include/ac_int.h:2501:11: error: no viable overloaded '|='
      res |= h;
      ~~~ ^  ~
ac_types-stable/include/ac_int.h:2205:11: note: candidate template ignored: could not match 'ac_int<W, S>' against 'int'
  ac_int &operator |= ( const ac_int<W2,S2> &op2 ) {
          ^
ac_types-stable/include/ac_int.h:2500:11: error: no viable overloaded '<<='
      res <<= 4;
      ~~~ ^   ~
ac_types-stable/include/ac_fixed.h:971:7: note: in instantiation of member function 'ac_int<29, false>::bit_fill_hex' requested here
    x.bit_fill_hex(str);
      ^
utils/cpp/src/MyUtils.cpp:220:7: note: in instantiation of member function 'ac_fixed<29, 29, false, AC_TRN, AC_SAT>::bit_fill_hex' requested here
    a.bit_fill_hex(ss.str().c_str());
      ^
ac_types-stable/include/ac_int.h:2251:11: note: candidate template ignored: could not match 'ac_int<W2, true>' against 'int'
  ac_int &operator <<= ( const ac_int<W2,true> &op2 ) {
          ^
ac_types-stable/include/ac_int.h:2259:11: note: candidate template ignored: could not match 'ac_int<W, false>' against 'int'
  ac_int &operator <<= ( const ac_int<W2,false> &op2 ) {
          ^

A possible fix would be this :

in ac_int.h lines 2500, 2501 change from :

res <<= 4;¬
res |= h;¬

to

res <<= ac_int<W,S>(4);
res |= ac_int<W,S>(h);

Please review. 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

1 participant