ssut / ffmpeg-on-apple-silicon

Build ffmpeg for ARM-based Apple Silicon Macs
222 stars 47 forks source link

error: variable 'supp_size' set but not used #10

Closed donly closed 1 year ago

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

+1

DevForrestWang commented 2 years ago

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

AsheyXD commented 2 years ago

Same here

dav01it commented 2 years ago

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

SelimEmre commented 1 year ago

+1 same

marcemq commented 1 year ago

I have the same error u.u

nick-scott commented 1 year ago

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
}
utk787 commented 1 year ago

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.