-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathclang++Warning.txt
151 lines (150 loc) · 6.54 KB
/
clang++Warning.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
(ch03)
init.cpp:8:15: warning: implicit conversion from 'double' to 'int' changes
value from 3.9832 to 3 [-Wliteral-conversion]
int guess(3.9832); // double converted to float
~~~~~ ^~~~~~
init.cpp:9:16: warning: implicit conversion from 'double' to 'int' changes
value from 7.2E+12 to 2147483647 [-Wliteral-conversion]
int debt = 7.2E12; // result not defined in C++
~~~~ ^~~~~~
2 warnings generated.
(ch04)
choices.cpp:27:5: warning: array index -2 is before the beginning of the array
[-Warray-bounds]
a1[-2] = 20.2;
^ ~~
choices.cpp:9:5: note: array 'a1' declared here
double a1[4] = {1.2, 2.4, 3.6, 4.8};
^
1 warning generated.
(ch05)
equal.cpp:16:31: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
for (i = 0; quizscores[i] = 20; i++)
~~~~~~~~~~~~~~^~~~
equal.cpp:16:31: note: place parentheses around the assignment to silence this
warning
for (i = 0; quizscores[i] = 20; i++)
^
( )
equal.cpp:16:31: note: use '==' to turn this assignment into an equality
comparison
for (i = 0; quizscores[i] = 20; i++)
^
==
1 warning generated.
(ch07)
arrfun2.cpp:31:25: warning: sizeof on array function parameter will return
size of 'int *' instead of 'int []' [-Wsizeof-array-argument]
std::cout << sizeof arr << " = sizeof arr\n";
^
arrfun2.cpp:25:17: note: declared here
int sum_arr(int arr[], int n)
^
1 warning generated.
strgfun.cpp:11:18: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char *wail = "ululate";
^
1 warning generated.
(ch08)
leftover.cpp:9:19: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * trip = "Hawaii!!"; // test value
^
1 warning generated.
strquote.cpp:57:12: warning: reference to stack memory associated with local
variable 'temp' returned [-Wreturn-stack-address]
return temp;
^~~~
1 warning generated.
(ch14)
worker0.cpp:46:24: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[] = {"other", "alto", "contralto",
^
worker0.cpp:46:33: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[] = {"other", "alto", "contralto",
^
worker0.cpp:46:41: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[] = {"other", "alto", "contralto",
^
worker0.cpp:47:13: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
worker0.cpp:47:24: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
worker0.cpp:47:32: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
worker0.cpp:47:44: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
7 warnings generated.
workermi.cpp:56:38: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[Singer::Vtypes] = {"other", "alto", "contralto",
^
workermi.cpp:56:47: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[Singer::Vtypes] = {"other", "alto", "contralto",
^
workermi.cpp:56:55: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
char * Singer::pv[Singer::Vtypes] = {"other", "alto", "contralto",
^
workermi.cpp:57:13: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
workermi.cpp:57:24: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
workermi.cpp:57:32: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
workermi.cpp:57:44: warning: conversion from string literal to 'char *' is
deprecated [-Wc++11-compat-deprecated-writable-strings]
"soprano", "bass", "baritone", "tenor"};
^
7 warnings generated.
(ch15)
rtti1.cpp:48:16: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (ps = dynamic_cast<Superb *>(pg))
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtti1.cpp:48:16: note: place parentheses around the assignment to silence this
warning
if (ps = dynamic_cast<Superb *>(pg))
^
( )
rtti1.cpp:48:16: note: use '==' to turn this assignment into an equality
comparison
if (ps = dynamic_cast<Superb *>(pg))
^
==
1 warning generated.
rtti2.cpp:48:16: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
if (ps = dynamic_cast<Superb *>(pg))
~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtti2.cpp:48:16: note: place parentheses around the assignment to silence this
warning
if (ps = dynamic_cast<Superb *>(pg))
^
( )
rtti2.cpp:48:16: note: use '==' to turn this assignment into an equality
comparison
if (ps = dynamic_cast<Superb *>(pg))
^
==
1 warning generated.