Discussion:
why does this generate a C2219?
(too old to reply)
andrey the giant
2009-09-27 05:33:52 UTC
Permalink
This generates a C2219 though the standard (C99) says it shouldn't.

typedef __int8 *i8p;
void foo(i8p __restrict bar){};

Is __restrict limited to explicit (T *) pointers as opposed to typedef-
ed (see example) ones?
Scot T Brennecke
2009-09-27 07:34:27 UTC
Permalink
Post by andrey the giant
This generates a C2219 though the standard (C99) says it shouldn't.
typedef __int8 *i8p;
void foo(i8p __restrict bar){};
Is __restrict limited to explicit (T *) pointers as opposed to typedef-
ed (see example) ones?
How about using this instead?
typedef __int8 * __restrict i8p;
void foo(i8p bar){};
Mateusz Loskot
2009-09-27 12:31:54 UTC
Permalink
Post by andrey the giant
This generates a C2219 though the standard (C99) says it shouldn't.
FYI, Visual C++ does not implement C99.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
andrey the giant
2009-09-27 13:50:59 UTC
Permalink
Post by Mateusz Loskot
Post by andrey the giant
This generates a C2219 though the standard (C99) says it shouldn't.
FYI, Visual C++ does not implement C99.
Yeah, it only implements bits and pieces the Microsoft Way (TM).
andrey the giant
2009-09-27 15:04:49 UTC
Permalink
Post by Mateusz Loskot
Post by andrey the giant
This generates a C2219 though the standard (C99) says it shouldn't.
FYI, Visual C++ does not implement C99.
Best regards,
--
Mateusz Loskot,http://mateusz.loskot.net
Charter Member of OSGeo,http://osgeo.org
Qouting MSDN:

"__restrict is similar to restrict from the C99 spec"


except that it doesn't work on implicit (typedef) pointer types
Wayne A. King
2009-09-28 02:45:11 UTC
Permalink
On Sat, 26 Sep 2009 22:33:52 -0700 (PDT), andrey the giant
Post by andrey the giant
This generates a C2219 though the standard (C99) says it shouldn't.
Which compiler and version are you using?

Note that VC++ 2008 and earlier do not implement C99, only C89/C90.

Neither, apparently, does VC++ 2010.

This page on VC++ 2010:

http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.100).aspx

says:

"This version of Visual C++ is not conformant with the C99 standard."

Some discussion of the rationale can be found in this blog:

http://blogs.msdn.com/somasegar/archive/2008/11/21/c-enhancements-in-vs-2010.aspx

- Wayne

- Wayne A. King
***@rogers.com

Loading...