Bug 193379 - va_start using non-POD-type
Summary: va_start using non-POD-type
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: All Other
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-12 03:26 PST by Thomas Klausner
Modified: 2019-01-12 03:26 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2019-01-12 03:26:35 PST
webkitgtk-2.22.25/Source/WebCore/platform/LocalizedStrings.cpp has as line 70

va_start(arguments, format);

The format argument is of type WTF::String.

clang 7.0.0 on NetBSD fails to compile this with the error message:

cannot pass object of non-trivial type 'WTF::String' through variadic function; call will abort at runtime [-Wnon-pod-varargs]

I've asked around and been told that the standard says that the argument must be a POD type, i.e. is not allowed to have a ctor or dtor, and that one possible workaround is to pass the argument as a pointer.