Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
e908591b
Commit
e908591b
authored
10 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
py: Abstract no-return attribute for functions a bit.
parent
b1ce37d3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/mpconfig.h
+3
-0
3 additions, 0 deletions
py/mpconfig.h
py/nlr.h
+3
-2
3 additions, 2 deletions
py/nlr.h
py/objstr.c
+1
-1
1 addition, 1 deletion
py/objstr.c
with
7 additions
and
3 deletions
py/mpconfig.h
+
3
−
0
View file @
e908591b
...
...
@@ -230,3 +230,6 @@ typedef double mp_float_t;
#define INT_FMT "%d"
#endif
#endif //INT_FMT
// Modifier for function which doesn't return
#define NORETURN __attribute__((noreturn))
This diff is collapsed.
Click to expand it.
py/nlr.h
+
3
−
2
View file @
e908591b
...
...
@@ -3,6 +3,7 @@
#include
<limits.h>
#include
<setjmp.h>
#include
"mpconfig.h"
typedef
struct
_nlr_buf_t
nlr_buf_t
;
struct
_nlr_buf_t
{
...
...
@@ -33,7 +34,7 @@ struct _nlr_buf_t {
#if MICROPY_NLR_SETJMP
extern
nlr_buf_t
*
nlr_setjmp_top
;
void
nlr_setjmp_jump
(
void
*
val
)
__attribute__
((
noreturn
))
;
NORETURN
void
nlr_setjmp_jump
(
void
*
val
);
// nlr_push() must be defined as a macro, because "The stack context will be
// invalidated if the function which called setjmp() returns."
#define nlr_push(buf) ((buf)->prev = nlr_setjmp_top, nlr_setjmp_top = (buf), setjmp((buf)->jmpbuf))
...
...
@@ -42,7 +43,7 @@ void nlr_setjmp_jump(void *val) __attribute__((noreturn));
#else
unsigned
int
nlr_push
(
nlr_buf_t
*
);
void
nlr_pop
(
void
);
void
nlr_jump
(
void
*
val
)
__attribute__
((
noreturn
))
;
NORETURN
void
nlr_jump
(
void
*
val
);
#endif
// This must be implemented by a port. It's called by nlr_jump
...
...
This diff is collapsed.
Click to expand it.
py/objstr.c
+
1
−
1
View file @
e908591b
...
...
@@ -27,7 +27,7 @@ const mp_obj_t mp_const_empty_bytes;
STATIC
mp_obj_t
mp_obj_new_str_iterator
(
mp_obj_t
str
);
STATIC
mp_obj_t
mp_obj_new_bytes_iterator
(
mp_obj_t
str
);
STATIC
mp_obj_t
str_new
(
const
mp_obj_type_t
*
type
,
const
byte
*
data
,
uint
len
);
STATIC
void
bad_implicit_conversion
(
mp_obj_t
self_in
)
__attribute__
((
noreturn
))
;
STATIC
NORETURN
void
bad_implicit_conversion
(
mp_obj_t
self_in
);
/******************************************************************************/
/* str */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment