Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/src/dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -3425,6 +3425,11 @@ final class CParser(AST) : Parser!AST
cparseParens();
}
}
else if (token.value == TOK._Noreturn)
{
specifier.noreturn = true;
nextToken();
}
else if (token.value == TOK.restrict) // ImportC assigns no semantics to `restrict`, so just ignore the keyword.
nextToken();
else
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/link.d
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ public int runPreprocessor(Loc loc, const(char)[] cpp, const(char)[] filename, c
*/
OutBuffer buf;
buf.writestring(cpp);
buf.printf(" /P /Zc:preprocessor /PD /nologo /utf-8 \"%.*s\" \"/FI%s\" \"/Fi%.*s\"",
buf.printf(" /std:c11 /P /Zc:preprocessor /PD /nologo /utf-8 \"%.*s\" \"/FI%s\" \"/Fi%.*s\"",
cast(int)filename.length, filename.ptr, importc_h, cast(int)output.length, output.ptr);

/* Append preprocessor switches to command line
Expand Down
2 changes: 2 additions & 0 deletions compiler/test/compilable/testcstuff1.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ void test2()

inline int f();
_Noreturn void g();
__declspec(noreturn) void g2();
__declspec(_Noreturn) void g3();

_Static_assert(1, "ok");
}
Expand Down
2 changes: 2 additions & 0 deletions druntime/src/importc.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ typedef unsigned long long __uint64_t;
/***************************
* C11 6.10.8.3 Conditional feature macros
*/
#if !(defined(_MSC_VER) && defined(__STDC_NO_VLA__)) // pre-defined to 1 by MS when using /std:cXX and causing warning C4117
#define __STDC_NO_VLA__ 1
#endif

#define _Float16 float
#ifdef __linux__ // Microsoft won't allow the following macro
Expand Down
4 changes: 0 additions & 4 deletions druntime/test/importc_compare/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ endif
include ../common.mak

extra_dflags += -d

ifeq ($(OS),windows)
extra_dflags += -P=/std:c11
endif
Loading