forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0507977
committed
Introduce pg_attribute_nonnull(...)
pg_attribute_nonnull(...) can be used to generate compiler warningswhen a function is called with the specified arguments set to NULL, asper an idea from Andres Freund. An empty argument list indicates thatno pointer arguments can be NULL. pg_attribute_nonnull() only works forcompilers that support the nonnull function attribute. If nonnull isnot supported, pg_attribute_nonnull() has no effect.As a beginning, this commit uses it for the DefineCustomXXXVariable()functions to generate warnings when the "name" and "value" arguments areset to NULL. This will likely be expanded to other places in thefuture, where it makes sense.Author: Nathan BossartReviewed by: Michael Paquier, Tom LaneDiscussion:https://postgr.es/m/20220525061739.ur7x535vtzyzkmqo@alap3.anarazel.de1 parentc99c67f commit0507977
2 files changed
+16
-5
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
147 | 158 |
| |
148 | 159 |
| |
149 | 160 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
307 | 307 |
| |
308 | 308 |
| |
309 | 309 |
| |
310 |
| - | |
| 310 | + | |
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
| |||
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
323 |
| - | |
| 323 | + | |
324 | 324 |
| |
325 | 325 |
| |
326 | 326 |
| |
| |||
333 | 333 |
| |
334 | 334 |
| |
335 | 335 |
| |
336 |
| - | |
| 336 | + | |
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
| |||
344 | 344 |
| |
345 | 345 |
| |
346 | 346 |
| |
347 |
| - | |
| 347 | + | |
348 | 348 |
| |
349 | 349 |
| |
350 | 350 |
| |
| |||
356 | 356 |
| |
357 | 357 |
| |
358 | 358 |
| |
359 |
| - | |
| 359 | + | |
360 | 360 |
| |
361 | 361 |
| |
362 | 362 |
| |
|
0 commit comments
Comments
(0)