Skip to content

Commit 3d23847

Browse files
author
kalibera
committed
Use C23 on Windows for R and R packages.
git-svn-id: https://svn.r-project.org/R/trunk@87747 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 63369bf commit 3d23847

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

doc/NEWS.Rd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@
241241
}
242242
}
243243

244-
%% \subsection{INSTALLATION on WINDOWS}{
245-
%% \itemize{
246-
%% \item Both building \R and installing packages use the C compiler
247-
%% in C23 mode. [In progress.]
248-
%% }
249-
%% }
244+
\subsection{INSTALLATION on WINDOWS}{
245+
\itemize{
246+
\item Both building \R and installing packages use the C compiler
247+
in C23 mode.
248+
}
249+
}
250250

251251
\subsection{DEPRECATED AND DEFUNCT}{
252252
\itemize{

src/gnuwin32/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MkRules: MkRules.rules
5959
@cat MkRules.rules > MkRules
6060
endif
6161

62-
CFLAGS = -O3 -Wall -pedantic $(EOPTS) $(SANOPTS) $(LTO)
62+
CFLAGS = -O3 -Wall -pedantic $(CSTD) $(EOPTS) $(SANOPTS) $(LTO)
6363
FFLAGS = -O3 $(EOPTS) $(LTO)
6464

6565
ifdef DEBUG
@@ -104,7 +104,7 @@ Rpwd.exe: front-ends/Rpwd.exe
104104
$(CP) $< $@
105105

106106
front-ends/Rpwd.exe:
107-
$(MK) -C front-ends Rpwd
107+
$(MK) -C front-ends CSTD='$(CSTD)' Rpwd
108108

109109
## watch out: R.dll and Rblas.dll depend on each other.
110110
rbuild:
@@ -204,7 +204,7 @@ libRiconv.dll.a: unicode/iconv.def
204204

205205

206206
front-ends:
207-
$(MK) -C front-ends
207+
$(MK) -C front-ends CSTD='$(CSTD)'
208208

209209
../extra/tre/libtre.a:
210210
$(MK) -C ../extra/tre -f Makefile.win

src/gnuwin32/MkRules.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@
149149
# if you do not have texinfo (default),
150150
# TEXI2ANY = missing
151151

152+
# C standard to use by default (override the compiler default)
153+
# CSTD = -std=gnu2x
154+
152155
# additional optimization flags (e.g. -mtune=native for a private build)
153156
#
154157
# -mstackrealign is used to avoid traps due to misaligned addresses with

src/gnuwin32/MkRules.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ TEXI2DVI = env COMSPEC= texi2dvi
9898
MAKEINFO = texi2any
9999
EOPTS ?= $(if $(USE_LLVM),,-mfpmath=sse -msse2 -mstackrealign)
100100
SANOPTS ?=
101+
CSTD ?= -std=gnu2x
101102
OPENMP ?= -fopenmp
102103
PTHREAD ?= -pthread
103104
ISDIR ?= C:/Program Files (x86)/Inno Setup 6

src/gnuwin32/fixed/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fixetc: $(ETC) ../MkRules Makefile
3030
$(MKDIR) -p $(R_HOME)/etc/$(R_ARCH)
3131
$(SED) -e 's/WIN = 64/WIN = $(WIN)/' \
3232
-e "s/-O3/-O2/" \
33+
-e "s/@CSTD@/$(CSTD)/" \
3334
-e "s/@EOPTS@/$(EOPTS)/" \
3435
-e "s/@SANOPTS@/$(SANOPTS)/" \
3536
-e "s|BINPREF =|BINPREF ?= $(BINPREF)|" \

src/gnuwin32/fixed/etc/Makeconf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ AR = $(BINPREF)$(LLVMPREF)ar
104104
BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas
105105
C_VISIBILITY =
106106
CC = $(BINPREF)$(CCBASE) $(M_ARCH)
107-
CFLAGS = -O3 -Wall $(DEBUGFLAG) @EOPTS@ @SANOPTS@ $(LTO)
107+
CFLAGS = -O3 -Wall @CSTD@ $(DEBUGFLAG) @EOPTS@ @SANOPTS@ $(LTO)
108108
CPICFLAGS =
109109
CPPFLAGS =
110110
CC17 = $(BINPREF)$(CCBASE) $(M_ARCH)

src/gnuwin32/front-ends/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include ../MkRules
22
R_HOME = ../../..
33

4-
CFLAGS = -O3 -Wall -pedantic
4+
CFLAGS = -O3 -Wall -pedantic $(CSTD)
55
ifdef DEBUG
66
CFLAGS += $(G_FLAG)
77
LINKFLAGS =

0 commit comments

Comments
 (0)