www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3004] New: [patch] Better handling of ignored pragmas

http://d.puremagic.com/issues/show_bug.cgi?id=3004

           Summary: [patch] Better handling of ignored pragmas
           Product: D
           Version: 1.030
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: fvbommel wxs.nl


Created an attachment (id=374)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=374)
Patch to fix these issues.

DMD offers the -ignore switch to ignore unrecognized pragmas.
However, this still has some issues:
 * An error is still generated when the pragma has a body (instead of just
ignoring the pragma attribute and using the body).
 * If any of the pragma parameters aren't semantically valid, an error is
generated if -v is specified on the command line. (e.g. if an undefined
identifier is used)

The following should compile with -ignore (and -ignore -v):
-----
module test;

extern(C) int printf(char*, ...);

pragma(GNU_attribute, flatten)
    void test() { printf("Hello GNU world!\n"); }

void main() {
    test();
}
-----
(And also if the pragma line has a ';' appended)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2009