This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bug in stdio using dynamic reent:


I've compiled newlib with __getreent() commented out and __DYNAMIC_REENT__
and REENTRANT_SYSCALLS_PROVIDED defined.  If I link it with the following
code, then the putchar and printf output is out of order.  I've confirmed
that this is broken on two different target platforms; powerpc and coldfire.
Has anyone else run into this behaviour?

Thanks,
g.

b0VIM
6.1Y½EUR>¿?³lglikelybeeblebrox.b
owman.gdcanada.com~glikely/gdc-working/testapp/main.c











3210#"!
U







































tpÿl





















































ad?Jl¸¶
z...figFDÝÛÌÊ~QÔ
Ó
°
Y
|
i
U
B
A
'




êæ¸S_^>< î
ß
Ð
½
«
-
EUR
~
}
e
c
M
2


ì
Æ
°
®
?
>
OE
<
|
{
F
#
ú	Ò	À	¿	?	p	G		
	
ݽ"lZY$Ø°?oefC/ùÙÅ?
o[MKJI














}    while(1);
fflush(stdout);    curr_impure_ptr = &impure2;    msg = "\r\n----Flushing
default process----\r\n";    fflush(stdout);    curr_impure_ptr =
&impure1;    msg = "\r\n----Flushing default process----\r\n";
fflush(stdout);    curr_impure_ptr = _impure_ptr;    msg =
"\r\n----Flushing default process----\r\n";    printtest(12);
//setvbuf(stdout, NULL, _IONBF, 0);    _write_r(NULL, 0, msg,
strlen(msg));    curr_impure_ptr = _impure_ptr;    msg = "\r\n----Testing
default process----\r\n";    printtest(8);    //setvbuf(stdout, NULL,
_IONBF, 0);    _write_r(NULL, 0, msg, strlen(msg));    curr_impure_ptr =
&impure2;    msg = "\r\n----Testing process 2----\r\n";    printtest(4);
//setvbuf(stdout, NULL, _IONBF, 0);    _write_r(NULL, 0, msg,
strlen(msg));    curr_impure_ptr = &impure1;    msg = "\r\n----Testing
process 1----\r\n";    printtest(0);    //setvbuf(stdout, NULL, _IONBF,
0);    _write_r(NULL, 0, msg, strlen(msg));    curr_impure_ptr =
_impure_ptr;    msg = "\r\n----Testing default process----\r\n";
IO_Init();    char *msg;{int main( void )}    putchar('D'+off);
printf("And again I say hello!");    putchar('C'+off);
printf("World!\r\n");    putchar('B'+off);    printf("\r\nHello, ");
putchar('A'+off);{void printtest(int off)}    f->_data = _NULL;
f->_lbfsize = 0;    f->_file = 0;    f->_flags = 0;    f->_w = 0;
f->_r = 0;    f->_p = _NULL;{void init_file(__FILE *f)}    return
curr_impure_ptr;{struct _reent *__getreent(void)struct _reent
*curr_impure_ptr = &impure1;struct _reent impure2 =
_REENT_INIT(impure2);struct _reent impure1 = _REENT_INIT(impure1); */ *
Reentrancy support/*int blank_var;int rwvar = 0x5678;const int rovar =
0x1234;#include <stdio.h>#include <stdlib.h>#include <reent.h>//
*******************************// Include files//
**************************************************************************
***************************/**  2001/12/01  1.0         Henk Kroon
Creation*  ----------  ---------   ------------
----------------------------*  Date        Version     Author
Changes**  Updated:   **  Copyright (c) Computing Devices Canada
(2001)*  *  Purpose:    Sample main() for object debugging**  Project:
BIDS HTS Coldfire**  Author:     Henk Kroon**  Date:       Dec, 2001**
File:
main.c*/******************************************************************
****

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]