Skip to content

pragma error preventing build #35

Description

@brainomite

A recent change was made to introduce pragma ignores #pragma GCC diagnostic ignored "-Wdangling-reference"

Environment: docker ubuntu:22.04
Commands that ultimately fail:

cd /tmp && git clone https://github.com/herumi/msoffice
cd /tmp/msoffice && make -j RELEASE=1

errors:

make -C src
make[1]: Entering directory '/tmp/msoffice/src'
g++ -c msoffice-crypt.cpp -o release/msoffice-crypt.o -g -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -O2 -DNDEBUG -I/tmp/msoffice/include -I/tmp/msoffice/../cybozulib/include
g++ -c attack.cpp -o release/attack.o -g -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -O2 -DNDEBUG -I/tmp/msoffice/include -I/tmp/msoffice/../cybozulib/include
In file included from msoffice-crypt.cpp:16:
/tmp/msoffice/include/decode.hpp: In function 'bool ms::decode(const char*, uint32_t, const String&, const string&, std::string&, bool, int*)':
/tmp/msoffice/include/decode.hpp:197:40: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
  197 |         #pragma GCC diagnostic ignored "-Wdangling-reference"
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
/tmp/msoffice/include/decode.hpp:197:40: note: did you mean '-Wdangling-else'?
In file included from /tmp/msoffice/include/attack.hpp:20,
                 from attack.cpp:14:
/tmp/msoffice/include/decode.hpp: In function 'bool ms::decode(const char*, uint32_t, const String&, const string&, std::string&, bool, int*)':
/tmp/msoffice/include/decode.hpp:197:40: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
  197 |         #pragma GCC diagnostic ignored "-Wdangling-reference"
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
/tmp/msoffice/include/decode.hpp:197:40: note: did you mean '-Wdangling-else'?
g++ release/attack.o -o /tmp/msoffice/bin/attack.exe  -lcrypto -L/tmp/msoffice/lib -lrt
/usr/bin/ld: cannot open output file /tmp/msoffice/bin/attack.exe: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [../common.mk:68: /tmp/msoffice/bin/attack.exe] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/msoffice/src'
make: *** [Makefile:7: all] Error 2

Temporary resolution, checkout sha c3cdb1e which is the prior commit
git checkout c3cdb1ea0a5285a2a1718fee2dc893fd884bdad0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions