VS2015 can't understand static inline functions

I have the following function defined in the visual studio makefile project header file, which ultimately builds in cwith msys-rtems:

static inline UInt32 timer_now() {
    ...

If the type UInt32is typedeffrom the included header file:

typedef unsigned long UInt32;

I get the following problems with my intellisense due to this function:

  • Intellisense does inlinenot offer a type name.>Error: Variable 'inline' is not a type name
  • Intellisense believes that the definition UInt32is this function instead typedef unsigned long.
  • If I delete the keyword inline, everything works fine (except that I don't want to, because this is the function we want to inline).
  • I don’t think this is completely related to mine typedef UInt32, because if I exchange this with help unsigned long, I still get the same problem.
  • Next to this, there are many other functions that use static inline doublethat have no error, unless they transfer the first function. Then they experience the same error.

I tried restarting VS2015 and deleting the database file SQL. I played with various intellisense options to no avail. Is this an intellisense bug?

As an additional note, a quick look at the rest of the project makes it look like the first function inlinein any h file has this problem.

Visual studio error opened here .

:

#ifndef SERVOSCHED_H 
#define SERVOSCHED_H

typedef unsigned long UInt32;
static inline UInt32 timer_now() {}

#endif

:

enter image description here

intellisense.

intellisense, . , , UInt32 :

static inline UInt32 timer_now() {

. UInt32, . , - , UInt32, , . , :

UInt32 ii;
...
for (ii = 0; ii < 10; ++ii) {

-

  • VS , ii undefined.
  • ii - .

UInt32 Int32 , , , , .

inline

, static inline . , . , . c GCC 3.4.5. - -, RTEMS Power PC 5200 BSP. , , ? ? . , , . . , .

, typedef:

typedef UInt32 inlineUInt32;

UInt32 static inline. UInt32, ( make ), Visual Studio, .

+4
2

Visual ++ IntelliSense C ( , C). Microsoft Connect: IntelliSense C99. ​​, Visual Studio 2015.

( Visual Studio 2015) inline, , , , Visual ++ IntelliSense .

#if defined _MSC_VER && defined __EDG__ && !defined __cplusplus
    #define inline
#endif

, . , , , /FI. ( , IntelliSense, , ).

+8

, "inline" . Expalanation:

  • timer_now() , inline , . , .
  • timer_now() , ""
  • timer_now() .cpp, inline , , , inline.
-4

Source: https://habr.com/ru/post/1609526/


All Articles