diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-189DA86A-BA77-4314-9597-E3C92B3C82D9.dita --- a/Symbian3/PDK/Source/GUID-189DA86A-BA77-4314-9597-E3C92B3C82D9.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-189DA86A-BA77-4314-9597-E3C92B3C82D9.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,44 +1,44 @@ - - - - - -Promoting <codeph>char</codeph> in -comparison with RVCTThe default char will be promoted to int on WINSCW and unsigned on -the RVCT compiler. Due to this promotion, comparison c != EOF will not become -true on hardware and it will loop infinite. -

RVCT treats plain char type as unsigned by -default. There is a command line option "--signed_chars" -that forces RVCT to treat plain char type as a signed char. Using this option, -the example will compile and run the way it is expected to. But -this option must be applied with care, since using the switch universally -may have other ramifications elsewhere in the source base.

-

The MMP file can be modified as:

-OPTION armcc --signed_chars -

Example:

-#include <stdio.h> -int main() -{ - FILE *fp; - char c; - fp=fopen("test.txt","w"); - fprintf(fp,"%s","ab"); - fclose(fp); - fp=fopen("test.txt","r"); - c=getc(fp); - while(c != EOF) - { - c = getc(fp); - } - printf("\nOut of loop"); - fclose(fp); - getchar(); -} - + + + + + +Promoting <codeph>char</codeph> in +comparison with RVCTThe default char will be promoted to int on WINSCW and unsigned on +the RVCT compiler. Due to this promotion, comparison c != EOF will not become +true on hardware and it will loop infinite. +

RVCT treats plain char type as unsigned by +default. There is a command line option "--signed_chars" +that forces RVCT to treat plain char type as a signed char. Using this option, +the example will compile and run the way it is expected to. But +this option must be applied with care, since using the switch universally +may have other ramifications elsewhere in the source base.

+

The MMP file can be modified as:

+OPTION armcc --signed_chars +

Example:

+#include <stdio.h> +int main() +{ + FILE *fp; + char c; + fp=fopen("test.txt","w"); + fprintf(fp,"%s","ab"); + fclose(fp); + fp=fopen("test.txt","r"); + c=getc(fp); + while(c != EOF) + { + c = getc(fp); + } + printf("\nOut of loop"); + fclose(fp); + getchar(); +} +
\ No newline at end of file