No subject
Fri Sep 2 03:59:05 CDT 2011
tion before its definition.
*looking deeper*
Ah; an old GCC bug[2] would report 'no previous prototype' warnings if nest=
ed functions are used with the "-Wmissing-prototypes" compiler flag. So if =
someone 1) used an old version of GCC and 2) enabled both that warning and =
"-Werror" in the CFLAGS they provide to configure, then we would have a fal=
se positive. Okay; I'll make the patch more robust.
[1]: http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
[2]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D36774
- David
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2102/#review7043
-----------------------------------------------------------
On Sept. 11, 2012, 11:30 a.m., David Lee wrote:
> =
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2102/
> -----------------------------------------------------------
> =
> (Updated Sept. 11, 2012, 11:30 a.m.)
> =
> =
> Review request for Asterisk Developers.
> =
> =
> Summary
> -------
> =
> In order to use nested functions on some versions of GCC (e.g. GCC on OS =
X), the -fnested-functions flag must be passed to the compiler.
> =
> This patch:
> * Adds detection logic to ./configure
> * Adds AST_NESTED_FUNCTIONS to ./makeopts.in
> * Includes AST_NESTED_FUNCTIONS in _ASTCFLAGS
> =
> =
> This addresses bug ASTERISK-20399.
> https://issues.asterisk.org/jira/browse/ASTERISK-20399
> =
> =
> Diffs
> -----
> =
> /branches/11/Makefile 372844 =
> /branches/11/configure UNKNOWN =
> /branches/11/configure.ac 372844 =
> /branches/11/include/asterisk/autoconfig.h.in 372844 =
> /branches/11/include/asterisk/utils.h 372844 =
> /branches/11/makeopts.in 372844 =
> =
> Diff: https://reviewboard.asterisk.org/r/2102/diff
> =
> =
> Testing
> -------
> =
> Compiled on OS X and Ubuntu 12.04.
> =
> =
> Thanks,
> =
> David
> =
>
--===============3809502172103495539==
Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
<html>
<body>
<div style=3D"font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor=3D"#f9f3c9" width=3D"100%" cellpadding=3D"8" style=3D"bor=
der: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href=3D"https://reviewboard.asterisk.org/r/2102/">https://reviewbo=
ard.asterisk.org/r/2102/</a>
</td>
</tr>
</table>
<br />
<blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; padd=
ing-left: 10px;">
<p style=3D"margin-top: 0;">On September 11th, 2012, 10:30 a.m., <b>Mark M=
ichelson</b> wrote:</p>
<blockquote style=3D"margin-left: 1em; border-left: 2px solid #d0d0d0; pad=
ding-left: 10px;">
=
<table width=3D"100%" border=3D"0" bgcolor=3D"white" style=3D"border: 1px s=
olid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan=3D"4" bgcolor=3D"#F0F0F0" style=3D"border-bottom: 1px solid =
#C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href=3D"https://reviewboard.asterisk.org/r/2102/diff/1/?file=3D31161=
#file31161line1043" style=3D"color: black; font-weight: bold; text-decorati=
on: underline;">/branches/11/configure.ac</a>
<span style=3D"font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style=3D"background-color: #e4d9cb; padding: 4px 8px; text-align: c=
enter;">
<tr>
<td colspan=3D"4"><pre style=3D"font-size: 8pt; line-height: 140%; margi=
n: 0; "></pre></td>
</tr>
</tbody>
=
=
<tbody>
<tr>
<th bgcolor=3D"#b1ebb0" style=3D"border-right: 1px solid #C0C0C0;" alig=
n=3D"right"><font size=3D"2"></font></th>
<td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "></pre></td>
<th bgcolor=3D"#b1ebb0" style=3D"border-left: 1px solid #C0C0C0; border=
-right: 1px solid #C0C0C0;" align=3D"right"><font size=3D"2">1043</font></t=
h>
<td bgcolor=3D"#c5ffc4" width=3D"50%"><pre style=3D"font-size: 8pt; lin=
e-height: 140%; margin: 0; "> [AC_LANG_PROGRAM([], [void foo(void) {void ba=
r(void) {}}])],</pre></td>
</tr>
</tbody>
</table>
<pre style=3D"white-space: pre-wrap; white-space: -moz-pre-wrap; white-sp=
ace: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm n=
ot sure how relevant this is, but I know that in all places in Asterisk whe=
re we use nested functions, we place the "auto" keyword in front =
of the function. This helps to clear up some compiler errors/warnings on ce=
rtain versions of GCC.
I'm not sure if your test is purposely leaving off "auto" or =
if you need to add it here in order to head off false positives.</pre>
</blockquote>
</blockquote>
<pre style=3D"margin-left: 1em; white-space: pre-wrap; white-space: -moz-pr=
e-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-=
word;">From the GCC docs[1], the "auto" keyword is only needed to=
declare the function before its definition.
*looking deeper*
Ah; an old GCC bug[2] would report 'no previous prototype' warnings=
if nested functions are used with the "-Wmissing-prototypes" com=
piler flag. So if someone 1) used an old version of GCC and 2) enabled both=
that warning and "-Werror" in the CFLAGS they provide to configu=
re, then we would have a false positive. Okay; I'll make the patch more=
robust.
[1]: http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
[2]: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D36774</pre>
<br />
<p>- David</p>
<br />
<p>On September 11th, 2012, 11:30 a.m., David Lee wrote:</p>
<table bgcolor=3D"#fefadf" width=3D"100%" cellspacing=3D"0" cellpadding=3D"=
8" style=3D"background-image: url('https://reviewboard.asterisk.org/media/r=
b/images/review_request_box_top_bg.png'); background-position: left top; ba=
ckground-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By David Lee.</div>
<p style=3D"color: grey;"><i>Updated Sept. 11, 2012, 11:30 a.m.</i></p>
<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Descripti=
on </h1>
<table width=3D"100%" bgcolor=3D"#ffffff" cellspacing=3D"0" cellpadding=3D"=
10" style=3D"border: 1px solid #b8b5a0">
<tr>
<td>
<pre style=3D"margin: 0; padding: 0; white-space: pre-wrap; white-space:=
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap=
: break-word;">In order to use nested functions on some versions of GCC (e.=
g. GCC on OS X), the -fnested-functions flag must be passed to the compiler.
This patch:
* Adds detection logic to ./configure
* Adds AST_NESTED_FUNCTIONS to ./makeopts.in
* Includes AST_NESTED_FUNCTIONS in _ASTCFLAGS</pre>
</td>
</tr>
</table>
<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing <=
/h1>
<table width=3D"100%" bgcolor=3D"#ffffff" cellspacing=3D"0" cellpadding=3D"=
10" style=3D"border: 1px solid #b8b5a0">
<tr>
<td>
<pre style=3D"margin: 0; padding: 0; white-space: pre-wrap; white-space:=
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap=
: break-word;">Compiled on OS X and Ubuntu 12.04.</pre>
</td>
</tr>
</table>
<div style=3D"margin-top: 1.5em;">
<b style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href=3D"https://issues.asterisk.org/jira/browse/ASTERISK-20399">ASTERIS=
K-20399</a>
</div>
<h1 style=3D"color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b>=
</h1>
<ul style=3D"margin-left: 3em; padding-left: 0;">
<li>/branches/11/Makefile <span style=3D"color: grey">(372844)</span></li>
<li>/branches/11/configure <span style=3D"color: grey">(UNKNOWN)</span></l=
i>
<li>/branches/11/configure.ac <span style=3D"color: grey">(372844)</span><=
/li>
<li>/branches/11/include/asterisk/autoconfig.h.in <span style=3D"color: gr=
ey">(372844)</span></li>
<li>/branches/11/include/asterisk/utils.h <span style=3D"color: grey">(372=
844)</span></li>
<li>/branches/11/makeopts.in <span style=3D"color: grey">(372844)</span></=
li>
</ul>
<p><a href=3D"https://reviewboard.asterisk.org/r/2102/diff/" style=3D"margi=
n-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============3809502172103495539==--
More information about the asterisk-dev
mailing list