[antlr-interest] Remarks about c# target

Sam Harwell sam at tunnelvisionlabs.com
Mon Apr 30 05:28:20 PDT 2012


[assembly: CLSCompliant(false)] has the same effect as not setting the
attribute on the assembly, except that you won't get the warnings about
other uses of the CLSCompliantAttribute. There's no reason to not mark the
assembly with the CLSCompliantAttribute (whether true or false), which means
there's no reason to offer a setting in code generation.

For projects properly using the CLSCompliantAttribute, if the attribute is
omitted in generated code then other compile time warnings will be issued.
The warning you are seeing indicates a proper warning in your project, so
with warnings as errors you'll need to correct the project configuration
before the build will succeed again.

--
Sam Harwell
Owner, Lead Developer
http://tunnelvisionlabs.com


-----Original Message-----
From: Costa Basil [mailto:costa_basil at yahoo.ca] 
Sent: Monday, April 30, 2012 2:26 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Remarks about c# target

I was wondering about this attribute as well. I don't care about it and as
far as I am concerned I would turn it off. Why is it necessary? Why don't
you offer a setting to control the generation of this attribute? 


Thanks



________________________________
 From: Sam Harwell <sam at tunnelvisionlabs.com>
To: forumer at smartmobili.com; antlr-interest at antlr.org
Sent: Thursday, April 26, 2012 8:36:42 PM
Subject: Re: [antlr-interest] Remarks about c# target
 
Yes, the attribute is necessary. You should add the following attribute to
your project:

[assembly: CLSCompliant(false)]

Since there is no warning for redundancy, this will make it stop printing
that warning/error.

--
Sam Harwell
Owner, Lead Developer
http://tunnelvisionlabs.com


-----Original Message-----
From: forumer at smartmobili.com [mailto:forumer at smartmobili.com]
Sent: Thursday, April 26, 2012 5:15 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Remarks about c# target

Hi,

I have some remarks about the c# target because I am working on a project
where warnings are treated as errors and the generated class have the
following attribute [System.CLSCompliant(false)] but when I compile I get
the following error :

Error    3    Warning as Error: 'EnadaLexer' does not need a CLSCompliant
attribute because the assembly does not have a CLSCompliant attribute

Is it really necessary to generate this attribute ?




List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list