Questions tagged [function-attributes]

36 questions
0
votes
1 answer

GCC - "has initializer but incomplete type" error when using macros for function attributes

I have a few header files with some simple glorified structs with just pure virtual methods defined within them. The code compiles fine on Windows with Visual Studio 2015, but GCC is getting stuck. First, the code: Code Listing namespace…
Cloud
  • 18,753
  • 15
  • 79
  • 153
0
votes
1 answer

GCC attributes influence on nested functions

Functions attributes can be specified only for function declaration (not definition). So, I can't specify attributes for nested function. For example: //invalid line. hot_nested_function is invisible outside "some_function" void…
0
votes
1 answer

const gcc function attribute and a global const variables

From GCC docs: Many functions do not examine any values except their arguments, and have no effects except the return value. Basically this is just slightly more strict class than the pure attribute above, since function is not allowed to…
griotspeak
  • 13,022
  • 13
  • 43
  • 54
0
votes
1 answer

how to specify attribute of GNU C?

In GUN C manual, 6.30 Declaring Attributes of Functions, it states: You may also specify attributes with __ preceding and following each keyword. This allows you to use them in header files without being concerned about a possible macro of the same…
Bill Wang
  • 197
  • 1
  • 10
-2
votes
1 answer

function attribute lifespan

I'm writing a memoization of a function and I want to store an attribute in the function object. Will the function attribute be available for the lifespan of the process? if not how can I achieve such a thing? Thank you
kambi
  • 3,291
  • 10
  • 37
  • 58
-3
votes
3 answers

Could the function used in std::thread (c++11) have [[noreturn]]?

For std::thread t(foo);, does it ever make sense to have a foo [[noreturn]] () {...}? For ex. for a detached thread (Used as a sort of daemon until the apps completion)?
Guest 86
  • 523
  • 1
  • 4
  • 11
1 2
3