Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
{{const}}\-qualified objects are likely to incur some runtime overhead  \[[Saks 2001b|AA. Bibliography#Saks 02]\]. Most C compilers, for example, allocate memory for {{const}}\-qualified objects. {{const}}\-qualified objects declared inside a function body maycan have automatic storage duration. If so, the compiler will allocate storage for the object, and it will be on the stack. As a result, this storage will need to be allocated and initialized each time the containing function is invoked.

...

Macro names do not observe the scope rules that apply to other names. ResultantlyTherefore, macros might could substitute in unanticipated places with unexpected results.

Object-like macros do not consume memory, and, consequently, it is not possible to create a pointer to one. Macros do not provide for type checking , as because they are textually replaced by the preprocessor.

Macros may can be passed as compile-time arguments.

...

In this noncompliant code example, the string literal "localhost" and integer constant 1234 are embedded directly in program logic , and are consequently difficult to change.

...

In this compliant solution, the host name and port number are both defined as object-like macros, so that may can be passed as compile-time arguments.

...

Replacing numeric constants with symbolic constants in this example does nothing to improve the readability of the code and may can actually make the code more difficult to read.

...