PR# 18998 [er] Argument names in C inline

Problem Report Summary
Submitter: axarosenberg
Category: C Compilation
Priority: Medium
Date: 2014/12/09
Class: Bug
Severity: Non-critical
Number: 18998
Release: 14.11.9.6209
Confidential: No
Status: Analyzed
Responsible:
Environment: windows
Synopsis: [er] Argument names in C inline

Description
When compiling the class below, we get this error during the compilation of the C code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\projects\bug_ise\eifgens\bug_ise\w_code\c2\aa33.c(29) : error C2065: '$camelCase' : undeclared identifier
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Indeed the generated C code looks like this:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void inline_F33_3105 (EIF_INTEGER_32 arg1, EIF_INTEGER_32 arg2)
{
	if ($camelCase == arg2) {}
	;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~

It should have been:

~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void inline_F33_3105 (EIF_INTEGER_32 arg1, EIF_INTEGER_32 arg2)
{
	if (arg1 == arg2) {}
	;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~
To Reproduce
class AA

create

	make

feature

	make
		do
			f (1, 1)
		end

	f (camelCase: INTEGER; a_lower_case: INTEGER)
		external
			"C inline"
		alias
			"if ($camelCase == $a_lower_case) {} "
		end

end
Problem Report Interactions
From:axarosenberg    Date:2014/12/09    Status: Analyzed    Download   
The Gobo compiler generates the following C code, regardless of the letter-case of the arguments:

/* AA.f */
void T21f2(T0* C, T6 a1, T6 a2)
{
if (a1 == a2) {} ;
}

From:manus_eiffel    Date:2014/12/09    Status: Analyzed    Download   
This is a known issue, our implementation uses an exact match to the lower case version of the argument name. It is indeed different from the standard specification which allows case insensitivity equality. For the time being, we would recommend using the Eiffel convention of using arguments in lowercase.