SourceForge has been redesigned. Learn more.
Close

#59 unsafe declarations in generic specification scope

closed-fixed
5
2010-07-31
2010-06-22
No

If a tagged type declaration in the component specification block of a generic component depends on a generic parameter, nesc generates code that substitutes the value of the generic parameter to the last instance of the component, rather than the value specific to a given instance. E.g., in the attached set of sources, the generated code correctly distinguishes two Protocol values, but both implementations of MyProtocol.protocol() return the same explicit constant. The problem arises from LcpAutomatonC.nc; excerpts from generated code are in WhatISee.txt.

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2010-06-22

    sources to reproduce problem

     
  • Peter A. Bigot

    Peter A. Bigot - 2010-06-30

    The same behavior occurs if the tagged value depends on an intrinsic; e.g. using:
    enum {
    NicId = unique(UQ_OIP_NETWORK_INTERFACE),
    };
    in the specification block allows NicId to be used in the implementation block, but all instances reference the last value generated by unique().

     
  • David Gay

    David Gay - 2010-07-31
    • status: open --> closed-fixed
     
  • David Gay

    David Gay - 2010-07-31

    Fixed in CVS.