public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information
@ 2013-09-18 15:56 psmith at gnu dot org
  2013-09-19 14:31 ` [Bug other/58467] " psmith at gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: psmith at gnu dot org @ 2013-09-18 15:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

            Bug ID: 58467
           Summary: Documentation of the "used" variable attribute needs
                    additional information
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: psmith at gnu dot org

The "used" variable attribute in the GCC documentation (gcc/doc/extend.texi,
section "Variable Attributes") says that it can be "attached to a variable".

However, this attribute cannot be applied to auto variables, only global or
static variables.  If you try to attach __attribute__((used)) to an auto
variable you'll get a confusing error saying that you can't do that, with no
reason why, and the documentation doesn't provide any guidance.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
@ 2013-09-19 14:31 ` psmith at gnu dot org
  2013-09-19 14:40 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: psmith at gnu dot org @ 2013-09-19 14:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

--- Comment #1 from Paul Smith <psmith at gnu dot org> ---
Housekeeping: it would be very nice to have a "Doc" component in bugzilla.  As
it was I picked "c" because it was that part of the docs.  Thx!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
  2013-09-19 14:31 ` [Bug other/58467] " psmith at gnu dot org
@ 2013-09-19 14:40 ` mpolacek at gcc dot gnu.org
  2013-09-20  6:08 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-09-19 14:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-19
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah.

I've just posted a patch that should clarify the doc a bit...


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
  2013-09-19 14:31 ` [Bug other/58467] " psmith at gnu dot org
  2013-09-19 14:40 ` mpolacek at gcc dot gnu.org
@ 2013-09-20  6:08 ` mpolacek at gcc dot gnu.org
  2013-09-20  6:09 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-09-20  6:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Fri Sep 20 06:08:44 2013
New Revision: 202764

URL: http://gcc.gnu.org/viewcvs?rev=202764&root=gcc&view=rev
Log:
2013-09-20  Marek Polacek  <polacek@redhat.com>

    PR other/58467
    * doc/extend.texi: Document that attribute used is meant to be used
    on variables with static storage duration.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/extend.texi


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
                   ` (2 preceding siblings ...)
  2013-09-20  6:08 ` mpolacek at gcc dot gnu.org
@ 2013-09-20  6:09 ` mpolacek at gcc dot gnu.org
  2013-09-20 14:26 ` psmith at gnu dot org
  2013-09-20 14:29 ` psmith at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-09-20  6:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
                   ` (3 preceding siblings ...)
  2013-09-20  6:09 ` mpolacek at gcc dot gnu.org
@ 2013-09-20 14:26 ` psmith at gnu dot org
  2013-09-20 14:29 ` psmith at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: psmith at gnu dot org @ 2013-09-20 14:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

--- Comment #5 from Paul Smith <psmith at gnu dot org> ---
Thank you!


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/58467] Documentation of the "used" variable attribute needs additional information
  2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
                   ` (4 preceding siblings ...)
  2013-09-20 14:26 ` psmith at gnu dot org
@ 2013-09-20 14:29 ` psmith at gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: psmith at gnu dot org @ 2013-09-20 14:29 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58467

--- Comment #6 from Paul Smith <psmith at gnu dot org> ---
A minor typo:

- attached to a variable with the static storage,
+ attached to a variable with static storage,

Also, I wonder if it might be helpful to be clear that it can ONLY be applied
to variables with static storage, or else you get a warning/error.  That would
require more substantial changes to the text though.

Cheers!


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-20 14:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-18 15:56 [Bug c/58467] New: Documentation of the "used" variable attribute needs additional information psmith at gnu dot org
2013-09-19 14:31 ` [Bug other/58467] " psmith at gnu dot org
2013-09-19 14:40 ` mpolacek at gcc dot gnu.org
2013-09-20  6:08 ` mpolacek at gcc dot gnu.org
2013-09-20  6:09 ` mpolacek at gcc dot gnu.org
2013-09-20 14:26 ` psmith at gnu dot org
2013-09-20 14:29 ` psmith at gnu 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).