|
|
Created:
4 years, 6 months ago by Paweł Hajdan Jr. Modified:
4 years, 6 months ago CC:
pdfium-reviews_googlegroups.com Base URL:
https://pdfium.googlesource.com/pdfium.git@master Target Ref:
refs/heads/master Project:
pdfium Visibility:
Public. |
DescriptionFix compile error ‘isnan’ was not declared in this scope
BUG=none
Committed: https://pdfium.googlesource.com/pdfium/+/f02f7e58b56b324d352322335636b3bf44d961d8
Patch Set 1 #
Messages
Total messages: 18 (5 generated)
The CQ bit was checked by phajdan.jr@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2022793002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2022793002/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: No L-G-T-M from a valid reviewer yet. CQ run can only be started by full committers or once the patch has received an L-G-T-M from a full committer. Even if an L-G-T-M may have been provided, it was from a non-committer, _not_ a full super star committer. Committers are members of the group "project-pdfium-committers". Note that this has nothing to do with OWNERS files.
phajdan.jr@chromium.org changed reviewers: + jochen@chromium.org, thestig@chromium.org
This is the full compile error I was getting: FAILED: obj/third_party/pdfium/xfa/fxbarcode/qrcode/xfa.BC_QRFinderPatternFinder.o x86_64-pc-linux-gnu-g++ -MMD -MF obj/third_party/pdfium/xfa/fxbarcode/qrcode/xfa.BC_QRFinderPatternFinder.o.d -DPDF_ENABLE_XFA -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DDISABLE_NACL -DCHROMIUM_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_HANGOUT_SERVICES_EXTENSION=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DFT2_BUILD_LIBRARY -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../.. -I../../third_party/pdfium -I../../third_party/pdfium/third_party/freetype/include -I../../third_party/pdfium/third_party/freetype/include/freetype -I../../v8 -I../../v8/include -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-strict-aliasing -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -O2 -pipe -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -std=gnu++11 -Wno-narrowing -c ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp -o obj/third_party/pdfium/xfa/fxbarcode/qrcode/xfa.BC_QRFinderPatternFinder.o In file included from ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp:32:0: ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp: In member function ‘FX_BOOL CBC_QRFinderPatternFinder::HandlePossibleCenter(const CFX_Int32Array&, int32_t, int32_t)’: ../../third_party/pdfium/xfa/fxbarcode/utils.h:34:31: error: ‘isnan’ was not declared in this scope #define FXSYS_isnan(x) isnan(x) ^ ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp:374:8: note: in expansion of macro ‘FXSYS_isnan’ if (!FXSYS_isnan(centerI)) { ^ ../../third_party/pdfium/xfa/fxbarcode/utils.h:34:31: note: suggested alternative: #define FXSYS_isnan(x) isnan(x) ^ ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp:374:8: note: in expansion of macro ‘FXSYS_isnan’ if (!FXSYS_isnan(centerI)) { ^ In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/random:38:0, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/bits/stl_algo.h:66, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/algorithm:62, from ../../third_party/pdfium/core/fxcrt/include/fx_basic.h:10, from ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.h:10, from ../../third_party/pdfium/xfa/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp:23: /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/cmath:641:5: note: ‘std::isnan’ isnan(_Tp __x) ^
What's the build environment where this is failing? Does this sample program work? ---- #include <math.h> int main() { return isnan(5) ? 1 : 0; } ---
On 2016/05/30 at 19:32:30, thestig wrote: > What's the build environment where this is failing? Does this sample program work? > > ---- > #include <math.h> > int main() { return isnan(5) ? 1 : 0; } > --- Why not use std::isnan everywhere?
On 2016/05/30 19:38:11, jochen wrote: > Why not use std::isnan everywhere? I'm curious why isnan() doesn't work as is.
On 2016/05/30 at 19:56:31, thestig wrote: > On 2016/05/30 19:38:11, jochen wrote: > > Why not use std::isnan everywhere? > > I'm curious why isnan() doesn't work as is isnan is c99 which msvs doesn't support while cmath / std::isnan is supported or something
On 2016/05/30 20:02:10, jochen wrote: > On 2016/05/30 at 19:56:31, thestig wrote: > > On 2016/05/30 19:38:11, jochen wrote: > > > Why not use std::isnan everywhere? > > > > I'm curious why isnan() doesn't work as is > > isnan is c99 which msvs doesn't support while cmath / std::isnan is supported or > something But this is on Linux and has nothing to do with MSVS. Basically the change is fine, but I'd like to understand why the code as is works fine on Ubuntu, but not on some other Linux system with GCC 5.3.
On 2016/05/30 at 19:32:30, thestig wrote: > What's the build environment where this is failing? Does this sample program work? > > ---- > #include <math.h> > int main() { return isnan(5) ? 1 : 0; } > --- $ g++ --version g++ (Gentoo 5.3.0 p1.1, pie-0.6.5) 5.3.0 This compiles: --- #include <math.h> int main() { return isnan(5.0) ? 1 : 0; } --- Now when I do this: --- #include <cmath> #include <math.h> int main() { return isnan(5.0) ? 1 : 0; } --- $ g++ math.c -o math $ echo $? 0 $ g++ -std=gnu++11 math.c math.c: In function 'int main()': math.c:3:30: error: 'isnan' was not declared in this scope int main() { return isnan(5.0) ? 1 : 0; } ^ math.c:3:30: note: suggested alternative: In file included from math.c:1:0: /usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/include/g++-v5/cmath:641:5: note: 'std::isnan' isnan(_Tp __x) ^ Interestingly, above compiles just fine with gcc in Ubuntu Trusty (g++ (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4).
The CQ bit was checked by thestig@chromium.org
lgtm I can reproduce this with g++ 5.3.1 on Ubuntu 16.04 as well. Looks like there wass a conflict between isnan() and std::isnan(), so now when <cmath> is included, isnan() does not get defined in math.h.
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2022793002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2022793002/1
Message was sent while issue was closed.
Description was changed from ========== Fix compile error ‘isnan’ was not declared in this scope BUG=none ========== to ========== Fix compile error ‘isnan’ was not declared in this scope BUG=none Committed: https://pdfium.googlesource.com/pdfium/+/f02f7e58b56b324d352322335636b3bf44d9... ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1) as https://pdfium.googlesource.com/pdfium/+/f02f7e58b56b324d352322335636b3bf44d9...
Message was sent while issue was closed.
On 2016/05/31 18:59:15, Lei Zhang wrote: > I can reproduce this with g++ 5.3.1 on Ubuntu 16.04 as well. Looks like there > wass a conflict between isnan() and std::isnan(), so now when <cmath> is > included, isnan() does not get defined in math.h. FWIW, I then built PDFium without this CL on the same Ubuntu 16.04 machine, but didn't hit this problem. *shrug* |