[Issue 3004] New: [patch] Better handling of ignored pragmas

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 17 14:48:20 PDT 2009


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 at digitalmars.com
        ReportedBy: fvbommel at 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: -------


More information about the Digitalmars-d-bugs mailing list