ffmpeg-on-apple-silicon icon indicating copy to clipboard operation
ffmpeg-on-apple-silicon copied to clipboard

error: variable 'supp_size' set but not used

Open donly opened this issue 2 years ago • 3 comments

hb-subset-cff1.cc:405:33: error: variable 'supp_size' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int  size0, size1, supp_size;
                                ^
1 error generated.
make[4]: *** [libharfbuzz_subset_la-hb-subset-cff1.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

donly avatar Jul 01 '22 16:07 donly

+1

hantmac avatar Jul 27 '22 10:07 hantmac

CXX libharfbuzz_subset_la-hb-subset-cff2.lo CXX libharfbuzz_subset_la-hb-subset-input.lo hb-subset-cff1.cc:405:33: error: variable 'supp_size' set but not used [-Werror,-Wunused-but-set-variable] unsigned int size0, size1, supp_size; ^ CXX libharfbuzz_subset_la-hb-subset-plan.lo 1 error generated. make[4]: *** [libharfbuzz_subset_la-hb-subset-cff1.lo] Error 1 make[4]: *** Waiting for unfinished jobs.... make[3]: *** [all-recursive] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1

DevForrestWang avatar Aug 03 '22 03:08 DevForrestWang

Same here

AsheyXD avatar Aug 08 '22 02:08 AsheyXD

You have to edit hb-subset-cff1.cc remove all the three references to the variable supp_size It's true what the compiler says: the var is unuseful: declared, set to 0 then set to another value but never used for computational purposes. Another solution would be to leave it and remove the "-Wunused-but-set-variable" flag to ignore it but we are compiling to have optimized code isn't it? hb-subset-cff1.cc.txt

dav01it avatar Oct 09 '22 11:10 dav01it

+1 same

SelimEmre avatar Nov 15 '22 18:11 SelimEmre

I have the same error u.u

marcemq avatar Feb 20 '23 05:02 marcemq

If you want a copy paste, here is a quick and dirty patch to get you going. (replace in build.bash)

function build_harfbuzz () {
  if [[ ! -e "${SRC}/lib/pkgconfig/harfbuzz.pc" ]]; then
    echo '♻️ ' Start compiling harfbuzz
    cd ${CMPLD}
    cd harfbuzz-2.7.2
    sed -i -e 's/unsigned int  size0, size1, supp_size;/unsigned int  size0, size1;/g' ./src/hb-subset-cff1.cc
    sed -i -e 's/supp_size = 0;//g' ./src/hb-subset-cff1.cc
    sed -i -e 's/supp_size += SuppEncoding::static_size \* supp_codes.length;//g' ./src/hb-subset-cff1.cc
    ./configure --prefix=${SRC} --disable-shared --enable-static
    make -j ${NUM_PARALLEL_BUILDS}
    make install
  fi
}

nick-scott avatar Feb 24 '23 01:02 nick-scott

If you want a copy paste, here is a quick and dirty patch to get you going. (replace in build.bash)

function build_harfbuzz () {
  if [[ ! -e "${SRC}/lib/pkgconfig/harfbuzz.pc" ]]; then
    echo '♻️ ' Start compiling harfbuzz
    cd ${CMPLD}
    cd harfbuzz-2.7.2
    sed -i -e 's/unsigned int  size0, size1, supp_size;/unsigned int  size0, size1;/g' ./src/hb-subset-cff1.cc
    sed -i -e 's/supp_size = 0;//g' ./src/hb-subset-cff1.cc
    sed -i -e 's/supp_size += SuppEncoding::static_size \* supp_codes.length;//g' ./src/hb-subset-cff1.cc
    ./configure --prefix=${SRC} --disable-shared --enable-static
    make -j ${NUM_PARALLEL_BUILDS}
    make install
  fi
}

Thanks for the suggestion, saved hours for me.

utk787 avatar May 05 '23 05:05 utk787