summaryrefslogtreecommitdiff
path: root/ACE/docs
diff options
context:
space:
mode:
authorLuke Mewburn <Luke@Mewburn.net>2022-09-10 11:05:56 +1000
committerLuke Mewburn <Luke@Mewburn.net>2022-09-10 11:05:56 +1000
commitf5e5d7759a9314053509d294a4c10827d3946034 (patch)
tree564ec43f4cab42439fbf543daa983cb57a89d666 /ACE/docs
parentc320b8022b5fd32b9237f1211f3f6d29c2192b21 (diff)
downloadATCD-f5e5d7759a9314053509d294a4c10827d3946034.tar.gz
Define ACE_TEXT_PRIs. Use to fix -Wformat-security
Define ACE_TEXT_PRIs as "s" or "ls" depending upon the WCHAR mode. (This is similar to the PRIxxx macros in <inttypes.h>) Use ACE_TEXT("%") ACE_TEXT_PRIs instead of "%s" or even just the raw string without a format specifier. Fixes issue #1906.
Diffstat (limited to 'ACE/docs')
-rw-r--r--ACE/docs/ACE-guidelines.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/ACE/docs/ACE-guidelines.html b/ACE/docs/ACE-guidelines.html
index 943b0191022..ab270f13aa8 100644
--- a/ACE/docs/ACE-guidelines.html
+++ b/ACE/docs/ACE-guidelines.html
@@ -809,6 +809,14 @@ Foo::bar ()
<li>Do not use the Win32 <code>TCHAR</code> macros. The wide character-ness of ACE
is separate from UNICODE and _UNICODE.
+ <li>If you have a <code>printf</code>-like format specifier that
+ uses <code>%s</code> to format a string, certain WCHAR implementations
+ require <code>%ls</code> instead.
+ The macro <code>ACE_TEXT_PRIs</code> contains <code>"s"</code> or <code>"ls"</code>
+ depending upon the WCHAR implementation, and may be used as
+ <code>ACE_TEXT("%") ACE_TEXT_PRI_s</code>, where the first argument may also
+ contain flags and width specifiers.
+
<li>For TAO, don't use <code>ACE_TCHAR</code> or <code>ACE_TEXT</code>. The CORBA specification
defines APIs as using char. So most of the time there is no need
to use wide characters.