VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/share/doc/gnustep-base-doc/CodingStandards/gs-standards/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/gnustep-base-doc/CodingStandards/gs-standards/Variable-Declaration.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Variable Declaration (Coding Standards for GNUstep Libraries)</title>

<meta name="description" content="Variable Declaration (Coding Standards for GNUstep Libraries)">
<meta name="keywords" content="Variable Declaration (Coding Standards for GNUstep Libraries)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="index.html" rel="up" title="Top">
<link href="Naming-Conventions.html" rel="next" title="Naming Conventions">
<link href="Error-Handling.html" rel="prev" title="Error Handling">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<span id="Variable-Declaration"></span><div class="header">
<p>
Next: <a href="Naming-Conventions.html" accesskey="n" rel="next">Naming Conventions</a>, Previous: <a href="Error-Handling.html" accesskey="p" rel="prev">Error Handling</a>, Up: <a href="index.html" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<hr>
<span id="Variable-Declaration-1"></span><h2 class="chapter">7 Variable Declaration</h2>

<p>All variables should be declared at the beginning of a block. The new
C99 standard (and gcc 3.X) allow variables to be declared anywhere in 
a block, including after executable code. However, in order to be compatible
with older compilers, all GNUstep programs should keep the old behaviour.
</p>
<p>Certainly we would consider it a bug to introduce code into the
GNUstep libraries which stopped them compiling with one of the
commonly used compilers.
</p>
<p>Instance variables in public APIs should generally be limited to those
which are explicitly declared to be public and which will never change
(we want to avoid breaking ABI between releases by changing instance
variable layouts).  Eventually compilers supporting a non-fragile ABI
will be available and this will no longer be an issue, but until then
we need to deal with the fragile API instance variable problem.
</p>
<p>The standard mechanism to support this is to provide a single private
pointer variable (void *_internal;) which will be used to point to an
area of memory containing the actual instance variables used internally.
The internal implementation is then free to change without any change
to the size of instances of the class.
</p>
<p>The GNUstep-base library has a standardised set of macros for writing
code which deals with use of an _internal pointer to instance variables
at the same time as allowing the instance variables to be used directly
in the class if the code is built using the non-fragile ABI.
</p>



</body>
</html>

VaKeR 2022