Main Page | Report this Page
 
Computers Forum Index  »  Computer Compilers - LCC  »  -nolibc problem...
Page 1 of 1    

-nolibc problem...

Author Message
Heiko Vogel...
Posted: Mon Oct 19, 2009 1:43 am
Guest
Hello!

Maybe I'am blind or stupid, but I've a problem...

For a small program the user should simply provide a driveletter
within the commandline. This looks like this:

example.exe /drive:m



I have used the wizard to generate a console-application, so I've
got the wellknown "HandleOptions"- Code. Okay...

/* add your option switches here */

case 'd':
case 'D':
if (!strnicmp(argv[i]+1,"drive:",6)){
if (isalpha(argv[i][7]))
szInputDrive[0] = toupper(argv[i][7]);
break;
}

"szInputDrive" is globally defined as:

char szInputDrive[] = "*:\\";

Until now, I can't see a problem. After the HandleOptions()-call
in main() I wrote this code:


// check if we got a character from A to Z
if (szInputDrive[0] == '*') {
printf("Invalid character found or \"drive:\" switch is missing.\n\
Valid driveletters should be in the range from \"A\" to
\"Z\".\n\nPress a key.\n");
getch();
return 1;
}

The code works as expected. But if I use the "-nolibc" switch for
the Linker, it seems that szInputDrive[0] will be always '*' and
the code fails. What's wrong (with me)?





BTW:
Since some days (14. October 2009) the software "AntiVir" reports
the trojan horse

TR/Agent.53475.A

in LCC.EXE. This might be (of course) a false alarm, because the
latest version of LCC-Win32 I used until today was built in
December 2008...

More information (in german):
http://forum.avira.com/wbb/index.php?page=Thread&threadID=99723


bfn hevo
 
Heiko Vogel...
Posted: Mon Oct 19, 2009 8:49 pm
Guest
Hello again!

As I can see, you are very interested in... ;)

At first, IsCharAlpha() from USER32-DLL satisfies my needs. So I
don't need (and don't use) isalpha() from crtdll.dll in the future.

However, IsCharAlpha() is not the real answer! I've played around
with setlocale() and so on... My code still failed. Whats up?
Sorry, I don't have the time to check this "in deep" at
assembly-language level.

bfn hevo
 
 
Page 1 of 1    
All times are GMT
The time now is Sun Nov 22, 2009 4:48 am