Re: Large writable variables
| От | Peter Eisentraut |
|---|---|
| Тема | Re: Large writable variables |
| Дата | |
| Msg-id | 08adbe4e-38f8-2c73-55f0-591392371687@2ndquadrant.com обсуждение исходный текст |
| Ответ на | Re: Large writable variables (Andres Freund <andres@anarazel.de>) |
| Ответы |
Re: Large writable variables
Re: Large writable variables |
| Список | pgsql-hackers |
On 17/10/2018 23:51, Andres Freund wrote: >> __builtin_types_compatible_p(const char *, char *) returns false (0) for me. > > Right, that's why I added a const, inside the macro, to the type > specified in the unconstify argument. So typeof() yields a const char *, > and the return type is specified as char *, and adding a const in the > argument also yields a const char *. Yeah, that works. The C++-inspired version also allowed casting from not-const to const, which we don't really need. I'd perhaps change the signature #define unconstify(underlying_type, var) because the "var" doesn't actually have to be a variable. Attached is my previous patch adapted to your macro. I'm tempted to get rid of the stuff in dfmgr.c and just let the "older platforms" get the warning. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Вложения
В списке pgsql-hackers по дате отправления: