Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error: InspectorProtocol.cpp:23:5: error: 'snprintf' is not a member of 'std' #10475

Closed
Labels
build Issues and PRs related to build files or the CI. inspector Issues and PRs related to the V8 inspector protocol

Comments

@Bilge
Copy link

Bilge commented Dec 27, 2016

  • Version: 6.7.0
  • Platform: Debian 8
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::intToStr(int, char*, size_t)':
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:23:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%d", number);
     ^
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr(double, char*, size_t)':
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:28:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%f", number);
     ^
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr3(double, char*, size_t)':
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:33:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%.3g", number);
     ^
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp: In function 'void blink::protocol::internal::doubleToStr6(double, char*, size_t)':
/root/buildroot-2016.11/output/build/nodejs-6.7.0/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:38:5: error: 'snprintf' is not a member of 'std'
     std::snprintf(buffer, length, "%.6g", number);
     ^

I am using a uClibc 0.9.33.2 toolchain (latest) available from this crosstool-NG project.

@mscdex mscdex added inspector Issues and PRs related to the V8 inspector protocol build Issues and PRs related to build files or the CI. labels Dec 27, 2016
@Bilge
Copy link
Author

Bilge commented Dec 28, 2016

I have since learned uClibc has been abandoned and forked as uClibc-ng. Upgrading to this version resolved the issue.

@Bilge Bilge closed this as completed Dec 28, 2016
@hanelyp
Copy link

hanelyp commented May 2, 2017

I'm getting what looks like the same error with nodejs 6.9.4 building on Gentoo
/var/tmp/portage/net-libs/nodejs-6.9.4/work/node-v6.9.4/out/Release/obj/gen/blink/platform/inspector_protocol/InspectorProtocol.cpp:23:5: error: 'snprintf' is not a member of 'std'
and repeats ...

Research suggests that this (and similar problems I'm having with other packages) relates to header file cleanup where some includes are no longer made indirectly.

@MylesBorins
Copy link
Member

@addaleax I believe this came up over at the tessel project as well /cc @rwaldron

We should likely be explicit about the headers. Would this be only for v6.x?

@addaleax
Copy link
Member

addaleax commented May 3, 2017

@MylesBorins Sorry, got a bit of an unexpected ping here … what can I do here? This doesn’t seem to be an issue on v6.x-staging, as far as I can tell … if it is, it’s quite likely that that’s a problem with the use libstdc++, not with the inspector code.

We should likely be explicit about the headers

Sorry, could you explain what you mean by that?

@MylesBorins
Copy link
Member

you we explicitly import the headers with the missing functions

@addaleax
Copy link
Member

addaleax commented May 4, 2017

yea but as far as I can tell the right headers are already included? :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment