...
Code Block |
---|
|
/* in a.c */
extern int i; /* UB #1415 */
int f(void) {
return ++i; /* UB #3437 */
}
/* in b.c */
short i; /* UB #1415 */
|
Noncompliant Code Example (Array Declarations)
...
Code Block |
---|
|
/* in a.c */
extern int *a; /* UB #1415 */
int f(unsigned i, int x) {
int tmp = a[i]; /* UB #3437: read access */
a[i] = x; /* UB #3437: write access*/
return tmp;
}
/* in b.c */
int a[] = { 1, 2, 3, 4 }; /* UB #1415 */
|
Noncompliant Code Example (Function Declarations)
...
Code Block |
---|
|
/* in a.c */
extern int f(int a); /* UB #1415 */
int g(int a) {
return f(a); /* UB #3941 */
}
/* in b.c */
long f(long a) { /* UB #1415 */
return a * 2;
}
|
Noncompliant Code Example (Excessively Long Identifiers)
...
Code Block |
---|
|
/* in bash/bashline.h */
extern char* bash_groupname_completion_function(const char*, int); /* UB #1415 */
/* in a.c */
#include <bashline.h>
void f(const char *s, int i) {
bash_groupname_completion_function(s, i); /* UB #3941 */
}
/* in b.c */
int bash_groupname_completion_func; /* UB #1415 */
|
Note: The identifier bash_groupname_completion_function
referenced here was taken from GNU Bash version 3.2.
...