Was searching the archives and found the post about using /*@abstract@*/ in a typedef. 
 That's almost what I'm after, but it's much too obstructive for me.  What I'd like is 
something along these lines:

        typedef /*@abstract@*/ int seconds;
        typedef /*@abstract@*/ int minutes;

        void test(void)
        {
                seconds tod_sec = (seconds)5;           // legal
                minutes tod_min = (minutes)7;           // legal

                tod_min++;                                      // legal
                tod_sec = tod_min;                      // illegal
                tod_min = 10;                           // illegal

                if (tod_min > tod_sec)                  // illegal
                        ;
        }

'tod_min = 10' may be clear in context, but it could easily be obfuscated by macros or 
less obvious variable names... so I'd be happy to see it trapped.

Reply via email to