Date: Wed, 18 Apr 2001 19:04:28 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: MINGW vs DJGPP In-Reply-To: <3ADDB56A.D939F09@ma.tum.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id MAA03073 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 18 Apr 2001, Waldemar Schultz wrote: > more problems with MINGW port of gcc-2.95.2: > > strw.c: > #include > #include > #include > > int main(void) > { > char *bbb="ABCDefgh"; > > strlwr(bbb); > printf("%s\n",bbb); > return EXIT_SUCCESS; > } > > #66:W98>gcc -c strw.c -g -W -Wall > #66:W98>gcc strw.o -o strw.exe -mwindows -mconsole > #66:W98>strw.exe > STRW verursachte einen Fehler durch eine ungültige Seite [error: invalid > page] This is a classic gotcha with GCC. The bug is in your program: you are trying to change a read-only string. GCC by default puts constant strings into read-only storage, so trying to modify it triggers a protection violation. This will happen on any platform; DJGPP avoids this problem because our .data and .text segments overlap (due to subtleties of exception handling in DPMI environment), and that prevents us from making the code segment write-protected. MinGW doesn't have this problem, so your bug is exposed.