diff mbox series

[pushed] Darwin: Fix a narrowing warning.

Message ID 20241107164643.15339-1-iain@sandoe.co.uk
State New
Headers show
Series [pushed] Darwin: Fix a narrowing warning. | expand

Commit Message

Iain Sandoe Nov. 7, 2024, 4:46 p.m. UTC
Tested on x86_64-darwin, pushed to trunk, thanks
Iain

--- 8< ---

cdtor_record needs to have an unsigned entry for the position in order to
match with vec_safe_length.

gcc/ChangeLog:

	* config/darwin.cc (cdtor_record): Make position unsigned.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/config/darwin.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config/darwin.cc b/gcc/config/darwin.cc
index ae821e32012..4e495fce82b 100644
--- a/gcc/config/darwin.cc
+++ b/gcc/config/darwin.cc
@@ -90,7 +90,7 @@  along with GCC; see the file COPYING3.  If not see
 typedef struct GTY(()) cdtor_record {
   rtx symbol;
   int priority;		/* [con/de]structor priority */
-  int position;		/* original position */
+  unsigned position;	/* original position */
 } cdtor_record;
 
 static GTY(()) vec<cdtor_record, va_gc> *ctors = NULL;