Bug 170098 - sscanf and stderr used without including cstdio
Summary: sscanf and stderr used without including cstdio
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-25 06:21 PDT by Ting-Wei Lan
Modified: 2017-04-07 12:04 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.03 KB, patch)
2017-03-25 06:23 PDT, Ting-Wei Lan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2017-03-25 06:21:21 PDT
This causes compilation error on FreeBSD:

/path/to/WebKit/Source/WTF/wtf/NumberOfCores.cpp:53:13: error: use of undeclared identifier 'sscanf'; did you mean 'vswscanf'?
        if (sscanf(coresEnv, "%u", &numberOfCores) == 1) {
            ^~~~~~
            vswscanf
/usr/include/wchar.h:192:5: note: 'vswscanf' declared here
int     vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
        ^
/path/to/WebKit/Source/WTF/wtf/NumberOfCores.cpp:53:20: error: cannot initialize a parameter of type 'const wchar_t *' with an lvalue of type 'const char *'
        if (sscanf(coresEnv, "%u", &numberOfCores) == 1) {
                   ^~~~~~~~
/usr/include/wchar.h:192:40: note: passing argument to parameter here
int     vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
                                           ^
/path/to/WebKit/Source/WTF/wtf/NumberOfCores.cpp:57:21: error: use of undeclared identifier 'stderr'
            fprintf(stderr, "WARNING: failed to parse WTF_numberOfProcessorCores=%s\n", coresEnv);
                    ^
2 warnings and 3 errors generated.
Comment 1 Ting-Wei Lan 2017-03-25 06:23:27 PDT
Created attachment 305376 [details]
Patch
Comment 2 WebKit Commit Bot 2017-04-07 12:04:03 PDT
Comment on attachment 305376 [details]
Patch

Clearing flags on attachment: 305376

Committed r215107: <http://trac.webkit.org/changeset/215107>
Comment 3 WebKit Commit Bot 2017-04-07 12:04:04 PDT
All reviewed patches have been landed.  Closing bug.