Bug 43359 - [Qt] Fix warnings: unknown conversion type character 'l' in format
Summary: [Qt] Fix warnings: unknown conversion type character 'l' in format
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Windows XP
: P3 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 43191
  Show dependency treegraph
 
Reported: 2010-08-02 09:33 PDT by Csaba Osztrogonác
Modified: 2014-01-29 07:46 PST (History)
5 users (show)

See Also:


Attachments
proposed fix #1 (1.57 KB, patch)
2010-08-11 09:20 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff
proposed fix #2 (1.37 KB, patch)
2010-08-11 10:13 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff
proposed fix #3 (5.04 KB, patch)
2010-08-12 06:52 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2010-08-02 09:33:44 PDT
Build QtWebKit on Windows with MinGW, there are some "warning: unknown conversion type character 'l' in format":

..\..\..\JavaScriptCore\wtf\text\WTFString.cpp:404:36: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\wtf\text\WTFString.cpp:404:36: warning: too many arguments for format

..\..\..\JavaScriptCore\wtf\text\WTFString.cpp:413:36: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\wtf\text\WTFString.cpp:413:36: warning: too many arguments for format

..\..\..\WebCore\loader\FTPDirectoryParser.cpp:191:47: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\loader\FTPDirectoryParser.cpp:191:47: warning: too many arguments for format

..\..\..\WebCore\platform\sql\SQLiteFileSystem.cpp:76:84: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\platform\sql\SQLiteFileSystem.cpp:76:84: warning: too many arguments for format

..\..\..\WebCore\platform\sql\SQLiteFileSystem.cpp:79:44: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\platform\sql\SQLiteFileSystem.cpp:79:44: warning: too many arguments for format

We should use SCN... and PRI... macros from inttypes.h to avoid using %lli, %llu, ...
Comment 1 Csaba Osztrogonác 2010-08-11 09:20:02 PDT
Created attachment 64122 [details]
proposed fix #1

Fix 4 warnings:

JavaScriptCore\wtf\text\WTFString.cpp:404:
return String::format("%lli", n);

JavaScriptCore\wtf\text\WTFString.cpp:413:
return String::format("%llu", n);

WebCore\platform\sql\SQLiteFileSystem.cpp:76:
fileName = pathByAppendingComponent(dbDir, String::format("%016llx.db", seq));

WebCore\platform\sql\SQLiteFileSystem.cpp:79:
return String::format("%016llx.db", seq);
Comment 2 Csaba Osztrogonác 2010-08-11 10:13:38 PDT
Created attachment 64132 [details]
proposed fix #2

Fix this warning:
..\..\..\WebCore\loader\FTPDirectoryParser.cpp:191:47: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\loader\FTPDirectoryParser.cpp:191:47: warning: too many arguments for format

I prefer PRI and SCN macros defined in inttypes.h, but 
I can't find any occurance of them in WebKit trunk.
Accordingly I propose a fix similar to String::number(...).

JavaScriptCore/wtf/text/WTFString.cpp:
...
String String::number(long long n)
{
#if OS(WINDOWS) && !PLATFORM(QT)
    return String::format("%I64i", n);
#else
    return String::format("%lli", n);
#endif
}
...
Comment 3 Csaba Osztrogonác 2010-08-12 06:52:09 PDT
Created attachment 64218 [details]
proposed fix #3

Fix 6 warnings (Windows - debug mode):

..\..\..\WebCore\platform\sql\SQLiteDatabase.cpp:159: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\platform\sql\SQLiteDatabase.cpp:159: warning: too many arguments for format

..\..\..\WebCore\storage\DatabaseTracker.cpp:689: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\storage\DatabaseTracker.cpp:689: warning: format '%s' expects type 'char*', but argument 5 has type 'long long unsigned int'
..\..\..\WebCore\storage\DatabaseTracker.cpp:689: warning: too many arguments for format

..\..\..\WebCore\loader\icon\IconDatabase.cpp:1313: warning: unknown conversion type character 'z' in format
..\..\..\WebCore\loader\icon\IconDatabase.cpp:1313: warning: too many arguments for format

..\..\..\WebCore\loader\icon\IconDatabase.cpp:1637: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\loader\icon\IconDatabase.cpp:1637: warning: too many arguments for format

..\..\..\WebCore\loader\icon\IconDatabase.cpp:1641: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\loader\icon\IconDatabase.cpp:1641: warning: too many arguments for format

..\..\..\WebCore\platform\graphics\qt\MediaPlayerPrivatePhonon.cpp:537: warning: unknown conversion type character 'l' in format
..\..\..\WebCore\platform\graphics\qt\MediaPlayerPrivatePhonon.cpp:537: warning: too many arguments for format
Comment 4 Antonio Gomes 2010-08-12 12:57:06 PDT
Comment on attachment 64122 [details]
proposed fix #1


> @@ -1,3 +1,20 @@
> +2010-08-11  Csaba Osztrogonác  <ossy@webkit.org>

maybe you could fix you name spell :)
Comment 5 Csaba Osztrogonác 2010-08-12 13:12:09 PDT
(In reply to comment #4)
> (From update of attachment 64122 [details])
> 
> > @@ -1,3 +1,20 @@
> > +2010-08-11  Csaba Osztrogonác  <ossy@webkit.org>
> 
> maybe you could fix you name spell :)

Bugzilla doesn't like me, but trac would be happy. ;)
Comment 6 Csaba Osztrogonác 2010-08-12 13:13:50 PDT
Adam, could you review "proposed fix #2" and 
"proposed fix #3" Windows related patches, please?
Comment 7 Csaba Osztrogonác 2010-08-12 13:28:28 PDT
Comment on attachment 64122 [details]
proposed fix #1

Clearing flags on attachment: 64122

Committed r65264: <http://trac.webkit.org/changeset/65264>
Comment 8 WebKit Review Bot 2010-08-12 14:30:45 PDT
http://trac.webkit.org/changeset/65264 might have broken SnowLeopard Intel Release (Tests)
Comment 9 Csaba Osztrogonác 2010-08-12 14:33:31 PDT
(In reply to comment #8)
> http://trac.webkit.org/changeset/65264 might have broken SnowLeopard Intel Release (Tests)

It must be a false positive alarm.
Comment 10 Csaba Osztrogonác 2010-08-16 08:04:30 PDT
Comment on attachment 64132 [details]
proposed fix #2

Landed in http://trac.webkit.org/changeset/65426.
Comment 11 Csaba Osztrogonác 2010-08-16 08:31:25 PDT
Comment on attachment 64218 [details]
proposed fix #3

Landed in http://trac.webkit.org/changeset/65427.
Comment 12 Csaba Osztrogonác 2010-09-23 09:13:53 PDT
Reopen, because there are more 5 warnings in JavaScriptCore\interpreter\Interpreter.cpp revealed by enabling JSVALUE32_64 on Windows:

..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:426: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:426: warning: too many arguments for format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:438: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:438: warning: too many arguments for format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:447: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:447: warning: too many arguments for format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:470: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:470: warning: too many arguments for format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:485: warning: unknown conversion type character 'l' in format
..\..\..\JavaScriptCore\interpreter\Interpreter.cpp:485: warning: too many arguments for format

Fix is coming soon.