diff mbox

[libiberty] Avoid compiler warnings in stack-limit.c

Message ID 64CD06AB-DEB2-47D0-A5EE-FB517D9AB9A3@adacore.com
State New
Headers show

Commit Message

Tristan Gingold March 30, 2012, 2:36 p.m. UTC
Hi,

there are some systems on which getrlimit/setrlimit are not available, and compiling stack-limit.c on these systems generates a warning.
Cleaned up with this patch.

Tested while building gcc for ia64-hp-openvms on x86_64-darwin.

Ok for trunk ?

Tristan.

libiberty/
2012-03-30  Tristan Gingold  <gingold@adacore.com>

	* stack-limit.c: Includes ansidecl.h.
	(stack_limit_increase): Add ATTRIBUTE_UNUSED

Comments

Ian Lance Taylor March 30, 2012, 3:46 p.m. UTC | #1
Tristan Gingold <gingold@adacore.com> writes:

> 2012-03-30  Tristan Gingold  <gingold@adacore.com>
>
> 	* stack-limit.c: Includes ansidecl.h.
> 	(stack_limit_increase): Add ATTRIBUTE_UNUSED

This is OK.

Thanks.

Ian
Tristan Gingold April 2, 2012, 7:51 a.m. UTC | #2
On Mar 30, 2012, at 5:46 PM, Ian Lance Taylor wrote:

> Tristan Gingold <gingold@adacore.com> writes:
> 
>> 2012-03-30  Tristan Gingold  <gingold@adacore.com>
>> 
>> 	* stack-limit.c: Includes ansidecl.h.
>> 	(stack_limit_increase): Add ATTRIBUTE_UNUSED
> 
> This is OK.

Thanks, committed.

Tristan.

> 
> Thanks.
> 
> Ian
diff mbox

Patch

diff --git a/libiberty/stack-limit.c b/libiberty/stack-limit.c
index e64cac2..82c3d44 100644
--- a/libiberty/stack-limit.c
+++ b/libiberty/stack-limit.c
@@ -34,6 +34,7 @@  Attempt to increase stack size limit to @var{pref} bytes if possible.
 */
 
 #include "config.h"
+#include "ansidecl.h"
 
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
@@ -43,7 +44,7 @@  Attempt to increase stack size limit to @var{pref} bytes if possible.
 #endif
 
 void
-stack_limit_increase (unsigned long pref)
+stack_limit_increase (unsigned long pref ATTRIBUTE_UNUSED)
 {
 #if defined(HAVE_SETRLIMIT) && defined(HAVE_GETRLIMIT) \
     && defined(RLIMIT_STACK) && defined(RLIM_INFINITY)