aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharvil Nanavati <sharvil@google.com>2015-04-14 12:01:55 -0700
committerAndre Eisenbach <eisenbach@google.com>2015-04-15 23:25:00 -0700
commitd7822d82ad56db0c1ef72ae0090c392f8fd5b4cb (patch)
treec43092a6da4609b58b8333c96dc98269d9011800
parentf88a7a197ab6652988e575ee419f6bc93b8c5b47 (diff)
downloadbt-d7822d82ad56db0c1ef72ae0090c392f8fd5b4cb.tar.gz
Add a section in style guide: __func__ should be used over __FUNCTION__.
Change-Id: I93eb3e512b6030818b06a63f13999bd45dcfec4e
-rw-r--r--doc/style_guide.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/style_guide.md b/doc/style_guide.md
index e08be0a4a..1637ed255 100644
--- a/doc/style_guide.md
+++ b/doc/style_guide.md
@@ -152,6 +152,12 @@ compile-time checks.
Use booleans to represent boolean state, instead of a set of masks into an
integer. It's more transparent and readable, and less error prone.
+### Function names as strings
+C99 defines `__func__` as an identifier that represents the function's name
+in which it is used. The magic identifier `__FUNCTION__` should not be used
+as it is a non-standard language extension and an equivalent standardized
+mechanism exists. In other words, use `__func__` over `__FUNCTION__`.
+
## Bluedroid conventions
This section describes coding conventions that are specific to Bluedroid.
Whereas the _Language_ section describes the use of language features, this