Skip to content

Commit 41bf9b9

Browse files
author
ripley
committed
gcc 15 reauires NORET before attribute_hidden
git-svn-id: https://svn.r-project.org/R/trunk@87740 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b35d063 commit 41bf9b9

File tree

8 files changed

+42
-43
lines changed

8 files changed

+42
-43
lines changed

src/include/R_ext/Error.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 1998-2024 The R Core Team
3+
* Copyright (C) 1998-2025 The R Core Team
44
*
55
* This header file is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -42,17 +42,16 @@ extern "C" {
4242
/* C23 has a [[noreturn]] attribute supported in LLVM clang 15 with
4343
* -std=c2x but not Apple clang 14. That and GCC verisions 12-14 have
4444
* version 202000L.
45-
* clang 19 has version 202301L (and supports -std=gnu23).
46-
* gcc pre-15 supports -std=gnu23 with version 202301L but barfs on
47-
* this attribute, so restrict to clang for now.
45+
* clang 19/20 have version 202301L (and support -std=gnu23).
46+
* gcc pre-15 supports -std=gnu23 with version 202301L
4847
*
4948
* https://en.cppreference.com/w/c/compiler_support/23
5049
* claims GCC 13 and LLVM clang 15 support [[noreturn]] ....
5150
*
5251
* In C11 there is _Noreturn * (or noreturn in header <stdnoreturn.h>).
5352
*/
5453
#if defined NORET
55-
#elif (defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202301L)
54+
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202301L)
5655
# define NORET [[noreturn]]
5756
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201102L
5857
# define NORET _Noreturn

src/main/context.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
33
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
4-
* Copyright (C) 1998-2020 The R Core Team.
4+
* Copyright (C) 1998-2025 The R Core Team.
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -212,7 +212,7 @@ static RCNTXT *first_jump_target(RCNTXT *cptr, int mask)
212212

213213
/* R_jumpctxt - jump to the named context */
214214

215-
attribute_hidden NORET void R_jumpctxt(RCNTXT * targetcptr, int mask, SEXP val)
215+
NORET attribute_hidden void R_jumpctxt(RCNTXT * targetcptr, int mask, SEXP val)
216216
{
217217
Rboolean savevis = R_Visible;
218218
RCNTXT *cptr;
@@ -334,7 +334,7 @@ void endcontext(RCNTXT * cptr)
334334

335335
/* findcontext - find the correct context */
336336

337-
attribute_hidden NORET void findcontext(int mask, SEXP env, SEXP val)
337+
NORET attribute_hidden void findcontext(int mask, SEXP env, SEXP val)
338338
{
339339
RCNTXT *cptr;
340340
cptr = R_GlobalContext;
@@ -356,7 +356,7 @@ attribute_hidden NORET void findcontext(int mask, SEXP env, SEXP val)
356356
}
357357
}
358358

359-
attribute_hidden NORET void R_JumpToContext(RCNTXT *target, int mask, SEXP val)
359+
NORET attribute_hidden void R_JumpToContext(RCNTXT *target, int mask, SEXP val)
360360
{
361361
RCNTXT *cptr;
362362
for (cptr = R_GlobalContext;

src/main/debug.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
33
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
4-
* Copyright (C) 1998-2020 The R Core Team.
4+
* Copyright (C) 1998-2025 The R Core Team.
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -175,14 +175,14 @@ attribute_hidden SEXP do_untracemem(SEXP call, SEXP op, SEXP args, SEXP rho)
175175

176176
#else
177177

178-
attribute_hidden NORET SEXP do_tracemem(SEXP call, SEXP op, SEXP args, SEXP rho)
178+
NORET attribute_hidden SEXP do_tracemem(SEXP call, SEXP op, SEXP args, SEXP rho)
179179
{
180180
checkArity(op, args);
181181
check1arg(args, call, "x");
182182
errorcall(call, _("R was not compiled with support for memory profiling"));
183183
}
184184

185-
attribute_hidden NORET SEXP do_untracemem(SEXP call, SEXP op, SEXP args, SEXP rho)
185+
NORET attribute_hidden SEXP do_untracemem(SEXP call, SEXP op, SEXP args, SEXP rho)
186186
{
187187
checkArity(op, args);
188188
check1arg(args, call, "x");

src/main/errors.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ NORET void errorcall(SEXP call, const char *format,...)
923923

924924
/* Like errorcall, but copies all data for the error message into a buffer
925925
before doing anything else. */
926-
attribute_hidden
927-
NORET void errorcall_cpy(SEXP call, const char *format, ...)
926+
NORET attribute_hidden
927+
void errorcall_cpy(SEXP call, const char *format, ...)
928928
{
929929
char buf[BUFSIZE];
930930

@@ -1342,7 +1342,7 @@ static SEXP findCall(void)
13421342
return R_NilValue;
13431343
}
13441344

1345-
attribute_hidden NORET SEXP do_stop(SEXP call, SEXP op, SEXP args, SEXP rho)
1345+
NORET attribute_hidden SEXP do_stop(SEXP call, SEXP op, SEXP args, SEXP rho)
13461346
{
13471347
/* error(.) : really doesn't return anything; but all do_foo() must be SEXP */
13481348
SEXP c_call;
@@ -1403,8 +1403,8 @@ attribute_hidden SEXP do_warning(SEXP call, SEXP op, SEXP args, SEXP rho)
14031403
}
14041404

14051405
/* Error recovery for incorrect argument count error. */
1406-
attribute_hidden
1407-
NORET void WrongArgCount(const char *s)
1406+
NORET attribute_hidden
1407+
void WrongArgCount(const char *s)
14081408
{
14091409
error(_("incorrect number of arguments to \"%s\""), s);
14101410
}
@@ -1444,8 +1444,8 @@ WarningDB[] = {
14441444
};
14451445

14461446

1447-
attribute_hidden
1448-
NORET void ErrorMessage(SEXP call, int which_error, ...)
1447+
NORET attribute_hidden
1448+
void ErrorMessage(SEXP call, int which_error, ...)
14491449
{
14501450
int i;
14511451
char buf[BUFSIZE];
@@ -2035,7 +2035,7 @@ attribute_hidden SEXP do_dfltWarn(SEXP call, SEXP op, SEXP args, SEXP rho)
20352035
return R_NilValue;
20362036
}
20372037

2038-
attribute_hidden NORET SEXP do_dfltStop(SEXP call, SEXP op, SEXP args, SEXP rho)
2038+
NORET attribute_hidden SEXP do_dfltStop(SEXP call, SEXP op, SEXP args, SEXP rho)
20392039
{
20402040
checkArity(op, args);
20412041

@@ -2117,7 +2117,7 @@ NORET static void invokeRestart(SEXP r, SEXP arglist)
21172117
}
21182118
}
21192119

2120-
attribute_hidden NORET
2120+
NORET attribute_hidden
21212121
SEXP do_invokeRestart(SEXP call, SEXP op, SEXP args, SEXP rho)
21222122
{
21232123
checkArity(op, args);
@@ -2677,8 +2677,8 @@ static void R_signalCondition(SEXP cond, SEXP call,
26772677
}
26782678
}
26792679

2680-
attribute_hidden /* for now */
2681-
NORET void R_signalErrorConditionEx(SEXP cond, SEXP call, int exitOnly)
2680+
NORET attribute_hidden /* for now */
2681+
void R_signalErrorConditionEx(SEXP cond, SEXP call, int exitOnly)
26822682
{
26832683
/* caller must make sure that 'cond' and 'call' are protected. */
26842684
R_signalCondition(cond, call, TRUE, exitOnly);
@@ -2694,8 +2694,8 @@ NORET void R_signalErrorConditionEx(SEXP cond, SEXP call, int exitOnly)
26942694
errorcall_dflt(call, "%s", translateChar(STRING_ELT(elt, 0)));
26952695
}
26962696

2697-
attribute_hidden /* for now */
2698-
NORET void R_signalErrorCondition(SEXP cond, SEXP call)
2697+
NORET attribute_hidden /* for now */
2698+
void R_signalErrorCondition(SEXP cond, SEXP call)
26992699
{
27002700
R_signalErrorConditionEx(cond, call, FALSE);
27012701
}

src/main/eval.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 1998--2024 The R Core Team.
3+
* Copyright (C) 1998--2025 The R Core Team.
44
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
55
*
66
* This program is free software; you can redistribute it and/or modify
@@ -2970,7 +2970,7 @@ attribute_hidden SEXP do_repeat(SEXP call, SEXP op, SEXP args, SEXP rho)
29702970
}
29712971

29722972

2973-
attribute_hidden NORET SEXP do_break(SEXP call, SEXP op, SEXP args, SEXP rho)
2973+
NORET attribute_hidden SEXP do_break(SEXP call, SEXP op, SEXP args, SEXP rho)
29742974
{
29752975
checkArity(op, args);
29762976
findcontext(PRIMVAL(op), rho, R_NilValue);
@@ -3008,7 +3008,7 @@ attribute_hidden SEXP do_begin(SEXP call, SEXP op, SEXP args, SEXP rho)
30083008
}
30093009

30103010

3011-
attribute_hidden NORET SEXP do_return(SEXP call, SEXP op, SEXP args, SEXP rho)
3011+
NORET attribute_hidden SEXP do_return(SEXP call, SEXP op, SEXP args, SEXP rho)
30123012
{
30133013
SEXP v;
30143014

@@ -9327,18 +9327,18 @@ SEXP do_bcprofstop(SEXP call, SEXP op, SEXP args, SEXP env)
93279327
return R_NilValue;
93289328
}
93299329
#else
9330-
attribute_hidden
9331-
NORET SEXP do_bcprofcounts(SEXP call, SEXP op, SEXP args, SEXP env) {
9330+
NORET attribute_hidden
9331+
SEXP do_bcprofcounts(SEXP call, SEXP op, SEXP args, SEXP env) {
93329332
checkArity(op, args);
93339333
error(_("byte code profiling is not supported in this build"));
93349334
}
9335-
attribute_hidden
9336-
NORET SEXP do_bcprofstart(SEXP call, SEXP op, SEXP args, SEXP env) {
9335+
NORET attribute_hidden
9336+
SEXP do_bcprofstart(SEXP call, SEXP op, SEXP args, SEXP env) {
93379337
checkArity(op, args);
93389338
error(_("byte code profiling is not supported in this build"));
93399339
}
9340-
attribute_hidden
9341-
NORET SEXP do_bcprofstop(SEXP call, SEXP op, SEXP args, SEXP env) {
9340+
NORET attribute_hidden
9341+
SEXP do_bcprofstop(SEXP call, SEXP op, SEXP args, SEXP env) {
93429342
checkArity(op, args);
93439343
error(_("byte code profiling is not supported in this build"));
93449344
}

src/main/objects.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
3-
* Copyright (C) 1999-2024 The R Core Team.
3+
* Copyright (C) 1999-2025 The R Core Team.
44
* Copyright (C) 2002-2023 The R Foundation
55
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
66
*
@@ -536,7 +536,7 @@ int usemethod(const char *generic, SEXP obj, SEXP call, SEXP args,
536536
*/
537537

538538
/* This is a primitive SPECIALSXP */
539-
attribute_hidden NORET
539+
NORET attribute_hidden
540540
SEXP do_usemethod(SEXP call, SEXP op, SEXP args, SEXP env)
541541
{
542542
static SEXP do_usemethod_formals = NULL;

src/main/util.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ extern "C" {
6161
# include <stddef.h> // for FC_LEN_T, usually size_t
6262
attribute_hidden
6363
void F77_SUB(rwarnc)(char *msg, int *nchar, FC_LEN_T msg_len);
64-
attribute_hidden
65-
NORET void F77_SUB(rexitc)(char *msg, int *nchar, FC_LEN_T msg_len);
64+
NORET attribute_hidden
65+
void F77_SUB(rexitc)(char *msg, int *nchar, FC_LEN_T msg_len);
6666
#else
6767
attribute_hidden
6868
void F77_SUB(rwarnc)(char *msg, int *nchar);
69-
attribute_hidden
70-
NORET void F77_SUB(rexitc)(char *msg, int *nchar);
69+
NORET attribute_hidden
70+
void F77_SUB(rexitc)(char *msg, int *nchar);
7171
#endif
7272

7373
#ifdef __cplusplus
@@ -372,7 +372,7 @@ NORET SEXP type2symbol(SEXPTYPE t)
372372
}
373373
#endif
374374

375-
attribute_hidden NORET
375+
NORET attribute_hidden
376376
void UNIMPLEMENTED_TYPEt(const char *s, SEXPTYPE t)
377377
{
378378
int i;

src/unix/sys-std.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* R : A Computer Language for Statistical Data Analysis
33
* Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka
4-
* Copyright (C) 1997--2024 The R Core Team
4+
* Copyright (C) 1997--2025 The R Core Team
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -1228,7 +1228,7 @@ attribute_hidden void Rstd_Busy(int which)
12281228
If ask = SA_SUICIDE, no save, no .Last, possibly other things.
12291229
*/
12301230

1231-
attribute_hidden NORET
1231+
NORET attribute_hidden
12321232
void Rstd_CleanUp(SA_TYPE saveact, int status, int runLast)
12331233
{
12341234
if(saveact == SA_DEFAULT) /* The normal case apart from R_Suicide */

0 commit comments

Comments
 (0)