Skip to content

mbed_retarget and IAR #7571

Closed
Closed
@Alex-EEE

Description

@Alex-EEE

Description

Does anyone know the reason / history behind this bit of code inside mbed_retarget, with regards to IAR?

int mbed_getc(std::FILE *_file){
#if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000)
    /*This is only valid for unbuffered streams*/
    int res = std::fgetc(_file);
    if (res>=0){
        _file->_Mode = (unsigned short)(_file->_Mode & ~ 0x1000);/* Unset read mode */
        _file->_Rend = _file->_Wend;
        _file->_Next = _file->_Wend;
    }
    return res;
#else
    return std::fgetc(_file);
#endif
}

I ask b/c this actually breaks getc in version 8.x. Was there an expectation this would be fixed in version 8.x? What is this code trying to work around for IAR's sake?

Issue request type

[ x ] Question
[ ] Enhancement
[ ] Bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions