Skip to content

Commit 5ff2d07

Browse files
committed
attributes
1 parent 386a0f8 commit 5ff2d07

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

cores/esp8266/core_esp8266_noniso.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232

3333
extern "C" {
3434

35-
char* ltoa(long value, char* result, int base) {
35+
char* ltoa(long value, char* result, int base) noexcept {
3636
return itoa((int)value, result, base);
3737
}
3838

39-
char* ultoa(unsigned long value, char* result, int base) {
39+
char* ultoa(unsigned long value, char* result, int base) noexcept {
4040
return utoa((unsigned int)value, result, base);
4141
}
4242

43-
char * dtostrf(double number, signed char width, unsigned char prec, char *s) {
43+
char * dtostrf(double number, signed char width, unsigned char prec, char *s) noexcept {
4444
bool negative = false;
4545

4646
if (isnan(number)) {
@@ -125,7 +125,7 @@ char * dtostrf(double number, signed char width, unsigned char prec, char *s) {
125125
126126
*/
127127
const char* strrstr(const char*__restrict p_pcString,
128-
const char*__restrict p_pcPattern)
128+
const char*__restrict p_pcPattern) noexcept
129129
{
130130
const char* pcResult = 0;
131131

cores/esp8266/stdlib_noniso.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// but is smaller by ~800B/flash and ~250B/rodata
2626

2727
// ulltoa fills str backwards and can return a pointer different from str
28-
char* ulltoa(unsigned long long val, char* str, int slen, unsigned int radix)
28+
char* ulltoa(unsigned long long val, char* str, int slen, unsigned int radix) noexcept
2929
{
3030
str += --slen;
3131
*str = 0;
@@ -39,7 +39,7 @@ char* ulltoa(unsigned long long val, char* str, int slen, unsigned int radix)
3939
}
4040

4141
// lltoa fills str backwards and can return a pointer different from str
42-
char* lltoa (long long val, char* str, int slen, unsigned int radix)
42+
char* lltoa (long long val, char* str, int slen, unsigned int radix) noexcept
4343
{
4444
bool neg;
4545
if (val < 0)

cores/esp8266/stdlib_noniso.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,36 @@
2626
extern "C"{
2727
#endif
2828

29-
int atoi(const char *s);
29+
#ifdef __cplusplus
30+
#define __STDLIB_NONISO_NOEXCEPT noexcept
31+
#else
32+
#define __STDLIB_NONISO_NOEXCEPT
33+
#endif
3034

31-
long atol(const char* s);
35+
int atoi(const char *s) __STDLIB_NONISO_NOEXCEPT;
3236

33-
double atof(const char* s);
37+
long atol(const char* s) __STDLIB_NONISO_NOEXCEPT;
3438

35-
char* itoa (int val, char *s, int radix);
39+
double atof(const char* s) __STDLIB_NONISO_NOEXCEPT;
3640

37-
char* ltoa (long val, char *s, int radix);
41+
char* itoa (int val, char *s, int radix) __STDLIB_NONISO_NOEXCEPT;
3842

39-
char* lltoa (long long val, char* str, int slen, unsigned int radix);
43+
char* ltoa (long val, char *s, int radix) __STDLIB_NONISO_NOEXCEPT;
4044

41-
char* utoa (unsigned int val, char *s, int radix);
45+
char* lltoa (long long val, char* str, int slen, unsigned int radix) __STDLIB_NONISO_NOEXCEPT;
4246

43-
char* ultoa (unsigned long val, char *s, int radix);
47+
char* utoa (unsigned int val, char *s, int radix) __STDLIB_NONISO_NOEXCEPT;
4448

45-
char* ulltoa (unsigned long long val, char* str, int slen, unsigned int radix);
49+
char* ultoa (unsigned long val, char *s, int radix) __STDLIB_NONISO_NOEXCEPT;
4650

47-
char* dtostrf (double val, signed char width, unsigned char prec, char *s);
51+
char* ulltoa (unsigned long long val, char* str, int slen, unsigned int radix) __STDLIB_NONISO_NOEXCEPT;
52+
53+
char* dtostrf (double val, signed char width, unsigned char prec, char *s) __STDLIB_NONISO_NOEXCEPT;
4854

4955
const char* strrstr(const char*__restrict p_pcString,
50-
const char*__restrict p_pcPattern);
56+
const char*__restrict p_pcPattern) __STDLIB_NONISO_NOEXCEPT;
57+
58+
#undef __STDLIB_NONISO_NOEXCEPT
5159

5260
#ifdef __cplusplus
5361
} // extern "C"

tools/sdk/include/ets_sys.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ void *ets_memset(void *s, int c, size_t n);
208208
void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer);
209209
void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg);
210210
void ets_timer_disarm(ETSTimer *a);
211-
int atoi(const char *nptr);
212211
int ets_strncmp(const char *s1, const char *s2, int len);
213212
int ets_strcmp(const char *s1, const char *s2);
214213
int ets_strlen(const char *s);

0 commit comments

Comments
 (0)