We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a844cf commit 75eba82Copy full SHA for 75eba82
C and C++.txt
@@ -129,6 +129,17 @@
129
argv 里面各个指针指向的貌似是同一段连续空间的不同位置,所以说可以从
130
argv[0]一直覆盖到 argv[argc]
131
132
+40、kernel中的max宏的设计有哪些考虑?
133
+ (tips:如果按照直观的考虑 max 宏的定义如下:
134
+ #define max(a,b) return (a)>(b)?(a):(b)
135
+ 但这样的定义在面对,max(a++, b++)这种调用会引入
136
+ 二义性,所以内核对max有改进
137
+ #define max(a, b)\
138
+ (typeof a) _a = a;\
139
+ (typeof b) _b = b;
140
+ (void) &a == &b;
141
+ return _a > _b ? _a : _b)
142
+
143
144
145
0 commit comments