public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/36906]  New: #pragma GNU poison index()
@ 2008-07-23  6:51 Dave at Yost dot com
  2008-07-23  7:09 ` Andrew Thomas Pinski
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dave at Yost dot com @ 2008-07-23  6:51 UTC (permalink / raw)
  To: gcc-bugs

There should be a way to poison a symbol only when it is used as a function or
macro call. I suggest that following a symbol with a pair of parentheses might
be a serviceable syntax for this. With this feature, the symbol rindex would
still be usable for variables.


-- 
           Summary: #pragma GNU poison index()
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Dave at Yost dot com


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


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

* Re: [Bug preprocessor/36906]  New: #pragma GNU poison index()
  2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
@ 2008-07-23  7:09 ` Andrew Thomas Pinski
  2008-07-23  7:10 ` [Bug preprocessor/36906] " pinskia at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Andrew Thomas Pinski @ 2008-07-23  7:09 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

Try the attribute deprecated.

Sent from my iPhone

On Jul 22, 2008, at 23:50, "Dave at Yost dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> There should be a way to poison a symbol only when it is used as a  
> function or
> macro call. I suggest that following a symbol with a pair of  
> parentheses might
> be a serviceable syntax for this. With this feature, the symbol  
> rindex would
> still be usable for variables.
>
>
> -- 
>           Summary: #pragma GNU poison index()
>           Product: gcc
>           Version: unknown
>            Status: UNCONFIRMED
>          Severity: enhancement
>          Priority: P3
>         Component: preprocessor
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: Dave at Yost dot com
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36906
>


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

* [Bug preprocessor/36906] #pragma GNU poison index()
  2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
  2008-07-23  7:09 ` Andrew Thomas Pinski
@ 2008-07-23  7:10 ` pinskia at gmail dot com
  2008-08-11  0:29 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gmail dot com @ 2008-07-23  7:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gmail dot com  2008-07-23 07:09 -------
Subject: Re:   New: #pragma GNU poison index()

Try the attribute deprecated.

Sent from my iPhone

On Jul 22, 2008, at 23:50, "Dave at Yost dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> There should be a way to poison a symbol only when it is used as a  
> function or
> macro call. I suggest that following a symbol with a pair of  
> parentheses might
> be a serviceable syntax for this. With this feature, the symbol  
> rindex would
> still be usable for variables.
>
>
> -- 
>           Summary: #pragma GNU poison index()
>           Product: gcc
>           Version: unknown
>            Status: UNCONFIRMED
>          Severity: enhancement
>          Priority: P3
>         Component: preprocessor
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: Dave at Yost dot com
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36906
>


-- 


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


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

* [Bug preprocessor/36906] #pragma GNU poison index()
  2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
  2008-07-23  7:09 ` Andrew Thomas Pinski
  2008-07-23  7:10 ` [Bug preprocessor/36906] " pinskia at gmail dot com
@ 2008-08-11  0:29 ` pinskia at gcc dot gnu dot org
  2008-09-02 19:23 ` tromey at gcc dot gnu dot org
  2008-12-24 23:16 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11  0:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-08-11 00:28 -------
Let me expand on what I mean by the attribute deprecated.
See http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Function-Attributes.html:

deprecated
The deprecated attribute results in a warning if the function is used anywhere
in the source file. This is useful when identifying functions that are expected
to be removed in a future version of a program. The warning also includes the
location of the declaration of the deprecated function, to enable users to
easily find further information about why the function is deprecated, or what
they should do instead. Note that the warnings only occurs for uses:
          int old_fn () __attribute__ ((deprecated));
          int old_fn ();
          int (*fn_ptr)() = old_fn;

results in a warning on line 3 but not line 2.

The deprecated attribute can also be used for variables and types (see Variable
Attributes, see Type Attributes.) 


-- 


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


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

* [Bug preprocessor/36906] #pragma GNU poison index()
  2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
                   ` (2 preceding siblings ...)
  2008-08-11  0:29 ` pinskia at gcc dot gnu dot org
@ 2008-09-02 19:23 ` tromey at gcc dot gnu dot org
  2008-12-24 23:16 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-09-02 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2008-09-02 19:22 -------
One problem with this approach is that this code would not error:

#include <string.h>
char (*fnptr)() = rindex;

I tend to agree with Andrew -- poisoning is too crude a tool for this use.

Is there a reason you do not use deprecation here?


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug preprocessor/36906] #pragma GNU poison index()
  2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
                   ` (3 preceding siblings ...)
  2008-09-02 19:23 ` tromey at gcc dot gnu dot org
@ 2008-12-24 23:16 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-24 23:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-12-24 23:07 -------
No answer in 3 months so closing.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2008-12-24 23:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-23  6:51 [Bug preprocessor/36906] New: #pragma GNU poison index() Dave at Yost dot com
2008-07-23  7:09 ` Andrew Thomas Pinski
2008-07-23  7:10 ` [Bug preprocessor/36906] " pinskia at gmail dot com
2008-08-11  0:29 ` pinskia at gcc dot gnu dot org
2008-09-02 19:23 ` tromey at gcc dot gnu dot org
2008-12-24 23:16 ` pinskia at gcc dot 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).