Skip to content

Wrong preprocessor line continuation with following empty line #9

Description

@adam-sse

srcML cannot parse the following code correctly:

#define MTS_INT_INIT()\
	struct mts_transfer_context* context = (struct mts_transfer_context*)transfer->context; \
	MTS_DEBUG_INT();\

#ifdef MTS_DO_DEBUG
    //...
#endif

srcML outputs:

<cpp:define>
	#
	<cpp:directive>
		define
	</cpp:directive>
	<cpp:macro>
		<name>
			MTS_INT_INIT
		</name>
		<parameter_list>
			()
		</parameter_list>
	</cpp:macro>
	\
	<cpp:value>
		struct mts_transfer_context* context = (struct mts_transfer_context*)transfer-
		>
		context; \
MTS_DEBUG_INT();\
		#ifdef MTS_DO_DEBUG
	</cpp:value>
</cpp:define>

This is obvioulsy wrong, since the #ifdef should be its own CPP statement. srcML seems to ignore that the line following the continuation is empty.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions