[Mono-dev] "fixed" as modifier

Jakob Petsovits jpetso at gmx.at
Sun Jul 23 20:03:25 EDT 2006

Hi Mono list,

I'm currently writing a C# LL parser for KDevelop, and use the numerous Mono 
source files as test cases for the parser. I've mainly been following the
C# specification, and found something in the Mono sources conflicting with it:

In mcs/tests/gtest-166.cs, there are field declarations where "fixed" is not 
used as statement, but as modifier for the variable. Quote:

public unsafe struct TestNew {
    private fixed char test_1 [128];
    public fixed bool test2 [4];

    public fixed int T [2];
    public fixed bool test20 [4], test21 [40];


Similar code is also found in mcs/tests/test-466.cs, and both were written by 
Marek Safar, whom I am cc'ing on this. (g)mcs is successfully compiling this.
But the "fixed" keyword is only specified as part of the fixed statement, not 
as variable modifier. (Both in the C# 1.0 and 2.0 specs.)
So, seen from an ECMA point of view, this code is invalid.

Should this be compilable even if it's not specified? Is it a mono bug?
Can someone tell me more about this?

(Please cc me, I'm not on the list.)

Thanks for clearing this up,

More information about the Mono-devel-list mailing list