public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field
[not found] <bug-62194-4@http.gcc.gnu.org/bugzilla/>
@ 2014-10-27 17:40 ` josh at joshtriplett dot org
2014-10-27 18:18 ` josh at joshtriplett dot org
2014-10-27 18:56 ` josh at joshtriplett dot org
2 siblings, 0 replies; 3+ messages in thread
From: josh at joshtriplett dot org @ 2014-10-27 17:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62194
--- Comment #1 from Josh Triplett <josh at joshtriplett dot org> ---
An additional corner case: a deadfield, even one that has a default value to
allow reads of it to work rather than erroring out, must be an rvalue, so that
attempts to take the address of it fail.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field
[not found] <bug-62194-4@http.gcc.gnu.org/bugzilla/>
2014-10-27 17:40 ` [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field josh at joshtriplett dot org
@ 2014-10-27 18:18 ` josh at joshtriplett dot org
2014-10-27 18:56 ` josh at joshtriplett dot org
2 siblings, 0 replies; 3+ messages in thread
From: josh at joshtriplett dot org @ 2014-10-27 18:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62194
--- Comment #2 from Josh Triplett <josh at joshtriplett dot org> ---
One alternative implementation: if GCC supported a "property" attribute,
specifying (optional) functions to get or set the property (with compile-time
errors if attempting to get/set a property for which the corresponding function
does not exist), that would completely address this issue as well: just define
a no-op setter and either a constant or non-existent getter.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field
[not found] <bug-62194-4@http.gcc.gnu.org/bugzilla/>
2014-10-27 17:40 ` [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field josh at joshtriplett dot org
2014-10-27 18:18 ` josh at joshtriplett dot org
@ 2014-10-27 18:56 ` josh at joshtriplett dot org
2 siblings, 0 replies; 3+ messages in thread
From: josh at joshtriplett dot org @ 2014-10-27 18:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62194
--- Comment #3 from Josh Triplett <josh at joshtriplett dot org> ---
(In reply to Josh Triplett from comment #2)
> One alternative implementation: if GCC supported a "property" attribute,
> specifying (optional) functions to get or set the property (with
> compile-time errors if attempting to get/set a property for which the
> corresponding function does not exist), that would completely address this
> issue as well: just define a no-op setter and either a constant or
> non-existent getter.
One issue with this approach: it would require the property mechanism to handle
initializers somehow.
So, on second thought, I think "deadfield" is still the right way to go.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-27 18:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-62194-4@http.gcc.gnu.org/bugzilla/>
2014-10-27 17:40 ` [Bug c/62194] Add deadfield attribute to ignore initializers for a structure field josh at joshtriplett dot org
2014-10-27 18:18 ` josh at joshtriplett dot org
2014-10-27 18:56 ` josh at joshtriplett dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).