diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-08-20 08:41:06 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-08-20 08:41:06 +0000 |
commit | 589e4748934cf2108be8564665f73bf1c4be4056 (patch) | |
tree | a79d166568e1d593531193cfdbf1e5df8407473f | |
parent | b9fb6b86c646361c14a5ba14244bd787baf45b1b (diff) | |
download | mpfr-589e4748934cf2108be8564665f73bf1c4be4056.tar.gz |
[doc/README.dev] Added a note about "string + integer" expressions.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14102 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | doc/README.dev | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/README.dev b/doc/README.dev index ccfc71854..f1e08805a 100644 --- a/doc/README.dev +++ b/doc/README.dev @@ -777,6 +777,24 @@ does not conform to the C standard by default. References: [*] https://stackoverflow.com/questions/4331200/what-do-f-and-d-mean-at-the-end-of-numeric-literals + ===================================================================== + +For string suffix selection, do not write expressions of the form +string + integer, such as + + "foo" + i + +because Clang emits a warning + + adding 'int' to a string does not append to the string [-Wstring-plus-int] + +Instead, one may write + + &"foo"[i] or (char *) "foo" + i + +(the first form is the one suggested by Clang, the second one is more +immediate to understand). + =========================================================================== Avoid variable names "l", "I" and "O", which look like "1" and "0" with |