scsitape / stenc

SCSI Tape Encryption Manager - stenc (formerly on https://sourceforge.net/projects/stenc/)
GNU General Public License v2.0
70 stars 17 forks source link

Compilation error #72

Closed sunwire closed 2 years ago

sunwire commented 2 years ago

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 commented 2 years ago

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