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

Compilation error #72

Closed
sunwire opened this issue May 14, 2022 · 1 comment
Closed

Compilation error #72

sunwire opened this issue May 14, 2022 · 1 comment

Comments

@sunwire
Copy link
Contributor

sunwire commented May 14, 2022

OS: Fedora 36 x86_64
g++ --version
g++ (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)

$ LANG=C make
make  all-recursive
make[1]: Entering directory '/home/pawel/stenc'
Making all in src
make[2]: Entering directory '/home/pawel/stenc/src'
depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I..    -std=c++17   -g -O2 -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.cpp &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo scsiencrypt.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I..    -std=c++17   -g -O2 -MT scsiencrypt.o -MD -MP -MF $depbase.Tpo -c -o scsiencrypt.o scsiencrypt.cpp &&\
mv -f $depbase.Tpo $depbase.Po
scsiencrypt.cpp: In function 'std::unique_ptr<const unsigned char []> scsi::make_sde(encrypt_mode, decrypt_mode, uint8_t, std::vector<unsigned char>, const std::string&, sde_rdmc, bool)':
scsiencrypt.cpp:236:28: error: cannot convert 'scsi::sde_rdmc' to 'std::byte' in initialization
  236 |   page.flags |= std::byte {rdmc};
      |                            ^~~~
      |                            |
      |                            scsi::sde_rdmc
make[2]: *** [Makefile:366: scsiencrypt.o] Error 1
make[2]: Leaving directory '/home/pawel/stenc/src'
make[1]: *** [Makefile:357: all-recursive] Error 1
make[1]: Leaving directory '/home/pawel/stenc'
make: *** [Makefile:298: all] Error 2
@jmwilson
Copy link
Contributor

It looks like GCC 12 is stricter about this conversion. I'll add an explicit static_cast

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