Skip to content

Commit

Permalink
W_EMPTY_STATEMENT, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thradams committed Aug 25, 2024
1 parent 6c878ce commit 49babc9
Show file tree
Hide file tree
Showing 14 changed files with 2,391 additions and 2,213 deletions.
10 changes: 5 additions & 5 deletions src/expressions.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ struct expression* _Owner _Opt character_constant_expression(struct parser_ctx*
// A UTF-8 character constant has type char8_t.
p_expression_node->type.type_specifier_flags = TYPE_SPECIFIER_UNSIGNED | TYPE_SPECIFIER_CHAR;

int c = 0;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == NULL)
{
Expand Down Expand Up @@ -617,7 +617,7 @@ struct expression* _Owner _Opt character_constant_expression(struct parser_ctx*
// A UTF-16 character constant has type char16_t which is an unsigned integer types defined in the <uchar.h> header
p_expression_node->type.type_specifier_flags = TYPE_SPECIFIER_UNSIGNED | TYPE_SPECIFIER_SHORT;

int c = 0;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == NULL)
{
Expand Down Expand Up @@ -647,7 +647,7 @@ struct expression* _Owner _Opt character_constant_expression(struct parser_ctx*
// A UTF-16 character constant has type char16_t which is an unsigned integer types defined in the <uchar.h> header
p_expression_node->type.type_specifier_flags = TYPE_SPECIFIER_UNSIGNED | TYPE_SPECIFIER_INT;

int c = 0;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == NULL)
{
Expand Down Expand Up @@ -690,7 +690,7 @@ struct expression* _Owner _Opt character_constant_expression(struct parser_ctx*
long long value = 0;
while (*p != '\'')
{
int c = 0;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == NULL)
{
Expand Down Expand Up @@ -746,7 +746,7 @@ struct expression* _Owner _Opt character_constant_expression(struct parser_ctx*
long long value = 0;
while (*p != '\'')
{
int c = 0;
unsigned int c = 0;
p = utf8_decode(p, &c);
if (p == NULL)
{
Expand Down
24 changes: 4 additions & 20 deletions src/file.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@

//C23 u8 character prefix
//https://open-std.org/JTC1/SC22/WG14/www/docs/n2418.pdf

static_assert(u8'÷' == 0xF7);
#pragma cake diagnostic check "-E1360"

static_assert(u8'ab');
#pragma cake diagnostic check "-E1370"

static_assert(u8'¡' != 0);
#pragma cake diagnostic check "-E1360"


static_assert(u8'~' == '~');
static_assert(_Generic(typeof(u8'~'), unsigned char : 1 , default: 0));

int main(){
unsigned char c = u8'~';
}
 int main(){
int i = 0;
if (i); // empty controlled statement found; is this the intent?
}
Loading

0 comments on commit 49babc9

Please sign in to comment.