public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/10406: Suggestion for variable attribute "default"
@ 2003-04-14 21:46 Benjamin Kalytta
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Kalytta @ 2003-04-14 21:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10406
>Category:       c
>Synopsis:       Suggestion for variable attribute "default"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 14 21:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Benjamin Kalytta <bkausbk@web.de>
>Release:        VERSION INDEPENDENT
>Organization:
>Environment:
EVERYTHING
>Description:
This is a suggestion for extending gcc syntax.
There should be "default" variable attribute.
Example:

typedef union _CPU_REG_64{
    long long int QW __attribute__((default));
    long int DW[2]
    short int W[4];
    char HW[8] 
} CPU_REG_64;

CPU_REG_64 Reg;

Reg=0x1234567890abcdef;

would be the same as ...

Reg.QW=0x1234567890abcdef;

because QW is defined as "default".

Only one "deafult" variable could be assigned within a struct/union.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c/10406: Suggestion for variable attribute "default"
@ 2003-04-14 22:26 Wolfgang Bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bangerth @ 2003-04-14 22:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/10406; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ices.utexas.edu>
To: "Benjamin K." <bkausbk@web.de>
Cc: bangerth@dealii.org, <gcc-bugs@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org>
Subject: Re: c/10406: Suggestion for variable attribute "default"
Date: Mon, 14 Apr 2003 17:24:28 -0500 (CDT)

 > It is at least same unimportant as some other attributes like
 > transparent_union, unused, deprecated or weak.
 
 Attribute unused is used in cases where in C++ you can write
   void f(int /*p*/) {
     ...; /* doesn't use p, but did in the past; we don't want to change 
             the prototype, though */
   }
 which you can't do in C.
 
 Deprecated was deemed useful enough to be included into the Java standard.
 
 Attribute weak changes the semantics of a function w.r.t. the linker.
 
 That being said, it might well be that some of the attributes are useless. 
 That should not tempt us into creating more uselessness, though.
 
 IMHO, your proposal is absolutely useless, since
 - one can get the same effect with a minimal change
 - it would have a ridiculously far-reaching impact since it would 
   essentially introduce overloading assignment operators in C.
 
 Wolfgang (certain to speak for the wider GCC community here)
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                                www: http://www.ices.utexas.edu/~bangerth/
 
 


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

* Re: c/10406: Suggestion for variable attribute "default"
@ 2003-04-14 22:16 Benjamin K.
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin K. @ 2003-04-14 22:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/10406; it has been noted by GNATS.

From: "Benjamin K." <bkausbk@web.de>
To: <bangerth@dealii.org>,
	<bkausbk@web.de>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c/10406: Suggestion for variable attribute "default"
Date: Tue, 15 Apr 2003 00:14:46 +0200

 It is at least same unimportant as some other attributes like
 transparent_union, unused, deprecated or weak.
 
 Benjamin Kalytta
 
 
 > Synopsis: Suggestion for variable attribute "default"
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: bangerth
 > State-Changed-When: Mon Apr 14 21:52:17 2003
 > State-Changed-Why:
 >     Will absolutely certainly not be implemented in gcc unless
 >     some standards body agrees that this is useful. Which is just
 >     as well very doubtful. This extension doesn't add anything
 >     at all that could not be done in a very simple way with
 >     other means.
 >     
 >     W.
 >     
 >     BTW: Use C++, there you can overload the assignement operator.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10406


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

* Re: c/10406: Suggestion for variable attribute "default"
@ 2003-04-14 21:52 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-04-14 21:52 UTC (permalink / raw)
  To: bkausbk, gcc-bugs, gcc-prs, nobody

Synopsis: Suggestion for variable attribute "default"

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Apr 14 21:52:17 2003
State-Changed-Why:
    Will absolutely certainly not be implemented in gcc unless
    some standards body agrees that this is useful. Which is just
    as well very doubtful. This extension doesn't add anything
    at all that could not be done in a very simple way with
    other means.
    
    W.
    
    BTW: Use C++, there you can overload the assignement operator.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10406


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

end of thread, other threads:[~2003-04-14 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-14 21:46 c/10406: Suggestion for variable attribute "default" Benjamin Kalytta
2003-04-14 21:52 bangerth
2003-04-14 22:16 Benjamin K.
2003-04-14 22:26 Wolfgang Bangerth

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).