Waitrud Weber’s blog

things and reminders for memories

C_Analyzer: Adapt to typedef: do not worry about the others but care of other schema.

Their answer is right if I have a good answer for schema.

 

int typedef_keywords ( STRUCT_FILE* structure_fp, char* p_dummy ) {
	int canread = 1;
//	char* p_dummy = NULL;
	char* p_dummy_token = NULL;

	if ( m_start_with ( (char*)p_dummy, "int" ) == 1 && canread == 1 ) {
		printf("we could find int.\r\n");
		canread = 2;
		sleep(2);
	} else if ( m_start_with ( (char*)p_dummy, "struct" ) == 1 && canread == 1  ) {
		printf("we could find struct.\r\n");
		canread = 2;
		sleep(2);
		exit(-1);
	} else if ( m_start_with ( (char*)p_dummy, "char" ) == 1 && canread == 1  ) {
		printf("we could find char.\r\n");
		canread = 2;
		sleep(2);
	} else if ( m_start_with ( (char*)p_dummy, "double" ) == 1 && canread == 1 ) {
		printf("we could find double.\r\n");
		canread = 2;
		sleep(2);
	} else if ( m_start_with ( (char*)p_dummy, "float" ) == 1 && canread == 1 ) {
		printf("we could find float.\r\n");
		canread = 2;
		sleep(2);
	}

	printf("typedef_keywords canread %d\r\n", canread);

	if ( canread == 2 ) return 1;

	return 0;
}

--- execution 001 ---
struct_fp.fp |2004393064| struct_fp.index |139|
struct_fp.fp |2004393064|
get_char ends.
typeofprimitive canread 1
typedef_keywords canread 1
i: 140 loop starts. level 2
struct_fp.fp |2004393064|
get_char starts.
struct_fp.fp |2004393064| struct_fp.index |140|
struct_fp.fp |2004393064|
get_char ends.
typeofprimitive canread 1
typedef_keywords canread 1
i: 141 loop starts. level 2
struct_fp.fp |2004393064|
get_char starts.
struct_fp.fp |2004393064| struct_fp.index |141|
struct_fp.fp |2004393064|
get_char ends.
typeofprimitive canread 1
typedef_keywords canread 1
i: 142 loop starts. level 2
struct_fp.fp |2004393064|
get_char starts.
struct_fp.fp |2004393064| struct_fp.index |142|
struct_fp.fp |2004393064|
get_char ends.
typeofprimitive canread 1
typedef_keywords canread 1
i: 143 loop starts. level 2
struct_fp.fp |2004393064|
get_char starts.
struct_fp.fp |2004393064| struct_fp.index |143|
struct_fp.fp |2004393064|
get_char ends.
typeofprimitive canread 1
we could find struct.
--- execution 001 ---