Mail Archives: djgpp-workers/2002/06/10/04:33:00
Hello.
Please find below a revised version of the patch to allow building
of the libc tests with gcc 3.1. Changes since the last version are:
* We now define __dj_va_rounded_size in stdarg.c, if was not defined
already.
* We use \n\ at the end of each line in system2.c. The text is also quoted -
previously the test was broken, because the string was not quoted.
* signals.c was fixed to avoid the warning due to the -Wbad-function-cast
option we use. We use promotion rather than a typecast, to convert
the return value of rand() to a double.
I have not changed sections.c, because I do not believe there is
anything wrong with the way I fixed it in the last patch. If people
disagree with that, please ignore the patch to sections.c and I will fix
it in another patch.
OK to commit?
Thanks, bye, Rich =]
Index: tests/libc/ansi/stdarg/stdarg.c
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libc/ansi/stdarg/stdarg.c,v
retrieving revision 1.1
diff -p -u -3 -r1.1 stdarg.c
--- tests/libc/ansi/stdarg/stdarg.c 1995/03/20 07:51:50 1.1
+++ tests/libc/ansi/stdarg/stdarg.c 2002/06/10 07:59:31
@@ -1,6 +1,16 @@
#include <stdio.h>
#include <stdarg.h>
+/*
+ * __dj_va_rounded_size's definition is copied from DJGPP's <stdarg.h>.
+ * GCC 3.x's <stdarg.h> may override DJGPP's, so __dj_va_rounded_size
+ * may not be defined for GCC 3.x (and perhaps later).
+ */
+#ifndef __dj_va_rounded_size
+#define __dj_va_rounded_size(T) \
+ (((sizeof (T) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
+#endif
+
void x(const char *f, ...)
{
const char *c;
Index: tests/libc/ansi/stdlib/system2.c
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libc/ansi/stdlib/system2.c,v
retrieving revision 1.2
diff -p -u -3 -r1.2 system2.c
--- tests/libc/ansi/stdlib/system2.c 1999/12/24 21:06:27 1.2
+++ tests/libc/ansi/stdlib/system2.c 2002/06/10 07:59:42
@@ -9,25 +9,25 @@ main (int argc, char **argv)
if (argc <= 1)
{
/* Assuming we have a djecho.exe: */
- res = system ("djecho
- William Safire's Rules for Writers:
-
-Remember to never split an infinitive. The passive voice should never be used.
-Do not put statements in the negative form. Verbs have to agree with their
-subjects. Proofread carefully to see if you words out. If you reread your work,
-you can find on rereading a great deal of repetition can be avoided by
-rereading and editing. A writer must not shift your point of view. And don't
-start a sentence with a conjunction. (Remember, too, a preposition is a
-terrible word to end a sentence with.) Don't overuse exclamation marks!!
-Place pronouns as close as possible, especially in long sentences, as of 10
-or more words, to their antecedents. Writing carefully, dangling participles
-must be avoided. If any word is improper at the end of a sentence, a linking
-verb is. Take the bull by the hand and avoid mixing metaphors. Avoid trendy
-locutions that sound flaky. Everyone should be careful to use a singular
-pronoun with singular nouns in their writing. Always pick on the correct idiom.
-The adverb always follows the verb. Last but not least, avoid cliches like the
-plague; seek viable alternatives.
-> rules.tmp");
+ res = system ("djecho \
+\" William Safire\'s Rules for Writers:\n\
+\n\
+Remember to never split an infinitive. The passive voice should never be used.\n\
+Do not put statements in the negative form. Verbs have to agree with their\n\
+subjects. Proofread carefully to see if you words out. If you reread your work,\n\
+you can find on rereading a great deal of repetition can be avoided by\n\
+rereading and editing. A writer must not shift your point of view. And don't\n\
+start a sentence with a conjunction. (Remember, too, a preposition is a\n\
+terrible word to end a sentence with.) Don't overuse exclamation marks!!\n\
+Place pronouns as close as possible, especially in long sentences, as of 10\n\
+or more words, to their antecedents. Writing carefully, dangling participles\n\
+must be avoided. If any word is improper at the end of a sentence, a linking\n\
+verb is. Take the bull by the hand and avoid mixing metaphors. Avoid trendy\n\
+locutions that sound flaky. Everyone should be careful to use a singular\n\
+pronoun with singular nouns in their writing. Always pick on the correct idiom.\n\
+The adverb always follows the verb. Last but not least, avoid cliches like the\n\
+plague; seek viable alternatives.\"\
+ > rules.tmp");
if (!res)
res = system ("sed s/s/z/g < rules.tmp | tail");
}
Index: tests/libc/crt0/sections.c
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libc/crt0/sections.c,v
retrieving revision 1.1
diff -p -u -3 -r1.1 sections.c
--- tests/libc/crt0/sections.c 1995/11/12 15:48:12 1.1
+++ tests/libc/crt0/sections.c 2002/06/10 07:59:42
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stddef.h>
int d1 = 0x12345678;
int d2 = 0x76543210;
@@ -23,7 +24,7 @@ main(void)
c = bss;
e = c + sizeof(bss);
- printf("bss scan from %p to %p, %lu bytes\n", c, e, e-c);
+ printf("bss scan from %p to %p, %d bytes\n", c, e, (ptrdiff_t) (e-c));
while (c < e)
{
if (*c)
Index: tests/libc/go32/signals.c
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libc/go32/signals.c,v
retrieving revision 1.1
diff -p -u -3 -r1.1 signals.c
--- tests/libc/go32/signals.c 1999/05/09 11:34:55 1.1
+++ tests/libc/go32/signals.c 2002/06/10 07:59:48
@@ -20,7 +20,7 @@ void int_handler(int sig)
if (sig != SIGINT)
abort();
puts ("\tSIGINT");
- urand = ((double)rand()) / RAND_MAX;
+ urand = rand() * 1.0 / RAND_MAX;
if (urand > 0.5)
result = urand / (rand() < 0);
else
- Raw text -