www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2382] New: spec is not clear on what is allowed as global/static initializers

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2382

           Summary: spec is not clear on what is allowed as global/static
                    initializers
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: tomas famolsen.dk


I can't find anywhere in the spec where it's clarified what can be used as a
global/static initializer (only some special cases, like static struct
initializers)

for example it's valid to initialize a global with the address of a function,
statically. however, for example, it's not allowed to cast this function
pointer to an integer even though there's no technical reason this should not
be allowed.


-- 
Oct 01 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2382


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2012-01-22
14:43:45 PST ---
Casting a pointer to an int may require halving its size, and the object file
format often does not support that.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2382



--- Comment #2 from github-bugzilla puremagic.com 2012-01-22 14:45:31 PST ---
Commit pushed to
https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/a23ff9898ceb21a5d6d861f7b884120f529fe631
fix Issue 2382 - spec is not clear on what is allowed as global/static
initializers

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2382


Walter Bright <bugzilla digitalmars.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012