OSDN Git Service

Add a section in style guide: __func__ should be used over __FUNCTION__.
authorSharvil Nanavati <sharvil@google.com>
Tue, 14 Apr 2015 19:01:55 +0000 (12:01 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Thu, 16 Apr 2015 06:25:00 +0000 (23:25 -0700)
Change-Id: I93eb3e512b6030818b06a63f13999bd45dcfec4e

doc/style_guide.md

index e08be0a..1637ed2 100644 (file)
@@ -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