Although C doesn’t have exceptions, its standard library includes two functions, setjmp and longjmp, that can be used together to return through more than one level of the call stack, typically as an error-handling mechanism when there’s no other way for a deeply nested function to stop and return an error. This chapter covers those functions.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

setjmp and longjmp

  • Paul J. Lucas

摘要

Although C doesn’t have exceptions, its standard library includes two functions, setjmp and longjmp, that can be used together to return through more than one level of the call stack, typically as an error-handling mechanism when there’s no other way for a deeply nested function to stop and return an error. This chapter covers those functions.