Skip to content

Newlib exception specification not matching error #452

@leemagnusson

Description

@leemagnusson

Summary
Different exception specifications in different parts of newlib.

To Reproduce
file tmp.cpp

#include <malloc.h>
#include <stdlib.h>

run:

clang++ -c --config=newlib.cfg --target=armv7em-none-eabihf -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -c tmp.cpp

Expected behavior
Compiles ok

Actual behavior

../lib/clang-runtimes/newlib/arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned/include/stdlib.h:299:8: error: exception specification in declaration does not match previous declaration
  299 | void *  _realloc_r (struct _reent *, void *, size_t) _NOTHROW;
      |         ^
../lib/clang-runtimes/newlib/arm-none-eabi/armv7m_hard_fpv4_sp_d16_exn_rtti_unaligned/include/malloc.h:58:14: note: previous declaration is here
   58 | extern void *_realloc_r (struct _reent *, void *, size_t);
      |              ^
8 errors generated.

Environment
Ubuntu 24.04. x86, with newlib overlay

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream-newlibUpstream newlib issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions