-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
examples/error-codes/violates-constraint/fatal/CV-CTI5-bad-static.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) 2015 Runtime Verification, Inc. (RV-Match team). All Rights Reserved. | ||
|
||
struct s { | ||
int s; | ||
int flex[]; | ||
}; | ||
|
||
struct s arr[5]; | ||
|
||
int main(void){ | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
examples/error-codes/violates-constraint/fatal/CV-CTI5-bad-static.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CV-CTI5-bad-static.c:8:1: error: Structs containing a flexible array member must not be array elements. | ||
Constraint violation (CV-CTI5). See C11 sec. 6.7.2.1:2 | ||
Translation failed (config dumped). Run kcc -d CV-CTI5-bad-static.c to see commands run. |
4 changes: 2 additions & 2 deletions
4
examples/error-codes/violates-constraint/nonfatal/CV-CDT3-bad-static.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CV-CDT3-bad-static.c:1:1: error: Field x has incomplete type. | ||
Constraint violation (CV-CDT3). See C11 sec. 6.7.2.1:3 | ||
CV-CDT3-bad-static.c:1:1: error: Field x has incomplete type or contains a flexible array member. | ||
Constraint violation (CV-CDT3). See C11 sec. 6.7.2.1:2 |
2 changes: 1 addition & 1 deletion
2
examples/error-codes/violates-constraint/nonfatal/CV-CDT4-bad-static.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CV-CDT4-bad-static.c:1:1: error: Field y has incomplete type. | ||
Constraint violation (CV-CDT4). See C11 sec. 6.7.2.1:3 | ||
Constraint violation (CV-CDT4). See C11 sec. 6.7.2.1:2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <stdlib.h> | ||
|
||
struct fam { | ||
int a; | ||
int fam[]; | ||
}; | ||
|
||
struct container { | ||
int b; | ||
struct fam f; // <-------------- flagged by gcc as compiler extension | ||
}; | ||
|
||
int main(void) { | ||
struct container * c = malloc(100 * sizeof(int)); | ||
c->b = 1; | ||
c->f.a = 2; | ||
c->f.fam[5] = 3; | ||
return c->f.fam[5]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
flexible-array.c:8:1: error: Field f has incomplete type or contains a flexible array member. | ||
Constraint violation (CV-CDT3). See C11 sec. 6.7.2.1:2 | ||
Translation failed (config dumped). Run kcc -d flexible-array.c to see commands run. |