lists.zerezo.com
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mingw-users] Well-optimizing compiler and a weirdness in the mailing list
- Date: Wed, 02 Jul 2008 20:52:53 +0200
- From: "Cornelius Riemenschneider" <c.r1@xxxxxx>
- Subject: [Mingw-users] Well-optimizing compiler and a weirdness in the mailing list
Hi,
1st: In my subscription-confirming mail It was stated i'm IP
>>We have received a request from 10.3.1.93 for subscription of your
10.x.x.x is the private class A-Network. It may be true for a sf.net-server but i'm definitly not reachable at this IP ;)
2nd: The reason i'm writing this: I thought of gcc as an optimizing compiler. But, the source at the end of the mail compiles to a winapp >800KB. Doing the same with MSVC++ 6 results in a 60KB app. COmpiling options for g++: -O0 -Os -pedantic -w -Wall -c -fmessage-length=0
the -O0 is caused by eclipse...
ld: -Wl,-O1
as: -O1 (may or may not be wrong...)
options for MSVC++:
/nologo /G6 /Gr /Zp1 /ML /W4 /GX /O1 /Ob2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"Release/" /Fd"Release/" /FD /c
looks maybe weird as they are build by the IDE...
Source:
Attention: this is a hack, copying some files from a samba share. Not all code is by me but from public domain. All important strings have been xxfied :P
#include <windows.h>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
char* pw="xxxx";
char *pathsrc="xxx";
string* inline doit(int, char **)
{
char ac[80];
if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR)
return 0;
struct hostent *phe = gethostbyname(ac);
if (phe == 0)
return 0;
string* lastAddr=new string;
for (int i = 0; phe->h_addr_list[i] != 0; ++i) {
struct in_addr addr;
memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
*lastAddr=inet_ntoa(addr);
}
return lastAddr;
}
void inline loadGame(void)
{
system("xxxx");
}
void inline getFiles(void)
{
NETRESOURCE netR;
netR.dwType=RESOURCETYPE_DISK;
netR.lpLocalName="J:";
netR.lpRemoteName="\\\\xxx";
netR.lpProvider=NULL;
WNetAddConnection2(&netR,pw,"ads",0);
system("xcopy xxx C:\\Programme /H /D:01-01-1970 /S /E /C /I /Z /Q /R");
WNetCancelConnection2("J:",0,true);
}
int __cdecl main(int count, char** ptr)
{
WSAData wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
return 255;
}
string* ret=doit(0,NULL);
if(*ret!="xx"&&*ret!="xxx"&&*ret!="xxx"&&*ret!="xxx")
{
char blub=*(char*)0;
return 0;
}
if(CreateDirectory("xxx",NULL)==ERROR_ALREADY_EXISTS)
{
loadGame();
return 0;
}
printf("text\n");
getFiles();
delete ret;
loadGame();
return 0;
}
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users