Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Administrator
Public Cpp Test
Commits
2a291a73
Commit
2a291a73
authored
Oct 23, 2023
by
shengnan hu
Browse files
main
parents
Changes
638
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
326 additions
and
0 deletions
+326
-0
BM-GJB8114-2013/R-1-13-13/R-1-13-13-good.cpp
BM-GJB8114-2013/R-1-13-13/R-1-13-13-good.cpp
+14
-0
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.c
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.c
+21
-0
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.cpp
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.cpp
+21
-0
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.c
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.c
+21
-0
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.cpp
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.cpp
+21
-0
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.c
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.c
+10
-0
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.cpp
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.cpp
+10
-0
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.c
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.c
+10
-0
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.cpp
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.cpp
+10
-0
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.c
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.c
+14
-0
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.cpp
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.cpp
+14
-0
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.c
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.c
+15
-0
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.cpp
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.cpp
+15
-0
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.c
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.c
+19
-0
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.cpp
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.cpp
+19
-0
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.c
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.c
+13
-0
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.cpp
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.cpp
+13
-0
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.c
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.c
+22
-0
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.cpp
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.cpp
+22
-0
BM-GJB8114-2013/R-1-13-4/R-1-13-4-good.c
BM-GJB8114-2013/R-1-13-4/R-1-13-4-good.c
+22
-0
No files found.
BM-GJB8114-2013/R-1-13-13/R-1-13-13-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
int
i
,
j
,
z
[
100
];
volatile
unsigned
int
v
=
1
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
j
=
v
;
//遵循1
z
[
i
]
=
3
*
j
*
j
+
2
*
j
+
i
;
}
return
(
0
);
}
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.c
0 → 100644
View file @
2a291a73
#include <stdlib.h>
int
fun
(
int
width
);
int
main
(
void
)
{
int
i
;
i
=
fun
(
NULL
);
//违背1
return
(
0
);
}
int
fun
(
int
width
)
{
int
w
;
w
=
width
-
10
;
return
w
;
}
BM-GJB8114-2013/R-1-13-14/R-1-13-14-bad.cpp
0 → 100644
View file @
2a291a73
#include <stdlib.h>
int
fun
(
int
width
);
int
main
(
void
)
{
int
i
;
i
=
fun
(
NULL
);
//违背1
return
(
0
);
}
int
fun
(
int
width
)
{
int
w
;
w
=
width
-
10
;
return
w
;
}
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.c
0 → 100644
View file @
2a291a73
#include <stdlib.h>
int
fun
(
int
width
);
int
main
(
void
)
{
int
i
;
i
=
fun
(
0
);
//遵循1
return
(
0
);
}
int
fun
(
int
width
)
{
int
w
;
w
=
width
-
10
;
return
w
;
}
BM-GJB8114-2013/R-1-13-14/R-1-13-14-good.cpp
0 → 100644
View file @
2a291a73
#include <stdlib.h>
int
fun
(
int
width
);
int
main
(
void
)
{
int
i
;
i
=
fun
(
0
);
//遵循1
return
(
0
);
}
int
fun
(
int
width
)
{
int
w
;
w
=
width
-
10
;
return
w
;
}
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
short
usX
;
usX
=
-
10
;
//违背1
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-15/R-1-13-15-bad.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
short
usX
;
usX
=
-
10
;
//违背1
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.c
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
short
usX
;
usX
=
(
unsigned
short
)
(
-
10
);
//遵循1
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-15/R-1-13-15-good.cpp
0 → 100644
View file @
2a291a73
int
main
(
void
)
{
unsigned
short
usX
;
usX
=
(
unsigned
short
)
(
-
10
);
//遵循1
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.c
0 → 100644
View file @
2a291a73
#include <stdio.h>
int
main
(
void
)
{
char
buf
[
8
];
buf
[
0
]
=
'y'
;
buf
[
1
]
=
'e'
;
buf
[
2
]
=
's'
;
//违背1
printf
(
"%s
\n
"
,
buf
);
return
(
0
);
}
BM-GJB8114-2013/R-1-13-16/R-1-13-16-bad.cpp
0 → 100644
View file @
2a291a73
#include <stdio.h>
int
main
(
void
)
{
char
buf
[
8
];
buf
[
0
]
=
'y'
;
buf
[
1
]
=
'e'
;
buf
[
2
]
=
's'
;
//违背1
printf
(
"%s
\n
"
,
buf
);
return
(
0
);
}
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.c
0 → 100644
View file @
2a291a73
#include <stdio.h>
int
main
(
void
)
{
char
buf
[
8
];
buf
[
0
]
=
'y'
;
buf
[
1
]
=
'e'
;
buf
[
2
]
=
's'
;
buf
[
3
]
=
'\0'
;
//遵循1
printf
(
"%s
\n
"
,
buf
);
return
(
0
);
}
BM-GJB8114-2013/R-1-13-16/R-1-13-16-good.cpp
0 → 100644
View file @
2a291a73
#include <stdio.h>
int
main
(
void
)
{
char
buf
[
8
];
buf
[
0
]
=
'y'
;
buf
[
1
]
=
'e'
;
buf
[
2
]
=
's'
;
buf
[
3
]
=
'\0'
;
//遵循1
printf
(
"%s
\n
"
,
buf
);
return
(
0
);
}
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.c
0 → 100644
View file @
2a291a73
int
sign
=
0
;
int
func
(
int
sign
)
//违背1
{
int
local
=
0
;
local
=
sign
;
//...
return
local
;
}
int
main
(
void
)
{
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-2/R-1-13-2-bad.cpp
0 → 100644
View file @
2a291a73
int
sign
=
0
;
int
func
(
int
sign
)
//违背1
{
int
local
=
0
;
local
=
sign
;
//...
return
local
;
}
int
main
(
void
)
{
//...
return
(
0
);
}
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.c
0 → 100644
View file @
2a291a73
void
misdis
(
void
)
{
//...
}
int
main
(
void
)
{
int
misdis
;
//违背1
misdis
=
0
;
return
(
0
);
}
BM-GJB8114-2013/R-1-13-3/R-1-13-3-bad.cpp
0 → 100644
View file @
2a291a73
void
misdis
(
void
)
{
//...
}
int
main
(
void
)
{
int
misdis
;
//违背1
misdis
=
0
;
return
(
0
);
}
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.c
0 → 100644
View file @
2a291a73
struct
POINTA
{
unsigned
int
x
;
unsigned
int
y
;
};
struct
POINTB
{
unsigned
int
y
;
unsigned
int
z
;
};
int
main
(
void
)
{
unsigned
int
POINTA
;
//违背1
struct
POINTB
POINTB
;
//违背2
POINTA
=
1
;
POINTB
.
y
=
POINTA
;
return
(
0
);
}
BM-GJB8114-2013/R-1-13-4/R-1-13-4-bad.cpp
0 → 100644
View file @
2a291a73
struct
POINTA
{
unsigned
int
x
;
unsigned
int
y
;
};
struct
POINTB
{
unsigned
int
y
;
unsigned
int
z
;
};
int
main
(
void
)
{
unsigned
int
POINTA
;
//违背1
struct
POINTB
POINTB
;
//违背2
POINTA
=
1
;
POINTB
.
y
=
POINTA
;
return
(
0
);
}
BM-GJB8114-2013/R-1-13-4/R-1-13-4-good.c
0 → 100644
View file @
2a291a73
struct
POINTA
{
unsigned
int
x
;
unsigned
int
y
;
};
struct
POINTB
{
unsigned
int
y
;
unsigned
int
z
;
};
int
main
(
void
)
{
unsigned
int
pot_y
;
//遵循1
struct
POINTB
spotb
;
//遵循2
pot_y
=
1
;
spotb
.
y
=
pot_y
;
return
(
0
);
}
Prev
1
…
6
7
8
9
10
11
12
13
14
…
32
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment