blog.oddbit.com/post/2023-02-17-c-error-handling

Preview meta tags from the blog.oddbit.com website.

Linked Hostnames

6

Thumbnail

Search Engine Appearance

Google

https://blog.oddbit.com/post/2023-02-17-c-error-handling

Simple error handling in C

Overview I was recently working with someone else’s C source and I wanted to add some basic error checking without mucking up the code with a bunch of if statements and calls to perror. I ended up implementing a simple must function that checks the return value of an expression, and exits with an error if the return value is less than 0. You use it like this: must(fd = open("textfile.txt", O_RDONLY)); Or:



Bing

Simple error handling in C

https://blog.oddbit.com/post/2023-02-17-c-error-handling

Overview I was recently working with someone else’s C source and I wanted to add some basic error checking without mucking up the code with a bunch of if statements and calls to perror. I ended up implementing a simple must function that checks the return value of an expression, and exits with an error if the return value is less than 0. You use it like this: must(fd = open("textfile.txt", O_RDONLY)); Or:



DuckDuckGo

https://blog.oddbit.com/post/2023-02-17-c-error-handling

Simple error handling in C

Overview I was recently working with someone else’s C source and I wanted to add some basic error checking without mucking up the code with a bunch of if statements and calls to perror. I ended up implementing a simple must function that checks the return value of an expression, and exits with an error if the return value is less than 0. You use it like this: must(fd = open("textfile.txt", O_RDONLY)); Or:

  • General Meta Tags

    8
    • title
      Simple error handling in C :: blog.oddbit.com
    • charset
      utf-8
    • viewport
      width=device-width,initial-scale=1
    • description
      Overview I was recently working with someone else’s C source and I wanted to add some basic error checking without mucking up the code with a bunch of if statements and calls to perror. I ended up implementing a simple must function that checks the return value of an expression, and exits with an error if the return value is less than 0. You use it like this: must(fd = open("textfile.txt", O_RDONLY)); Or:
    • keywords
  • Open Graph Meta Tags

    9
    • og:locale
      en
    • og:type
      article
    • og:title
      Simple error handling in C
    • og:description
      Overview I was recently working with someone else’s C source and I wanted to add some basic error checking without mucking up the code with a bunch of if statements and calls to perror. I ended up implementing a simple must function that checks the return value of an expression, and exits with an error if the return value is less than 0. You use it like this: must(fd = open("textfile.txt", O_RDONLY)); Or:
    • og:url
      https://blog.oddbit.com/post/2023-02-17-c-error-handling/
  • Twitter Meta Tags

    1
    • twitter:card
      summary
  • Link Tags

    5
    • apple-touch-icon
      https://blog.oddbit.com/img/theme-colors/orange.png
    • canonical
      https://blog.oddbit.com/post/2023-02-17-c-error-handling/
    • shortcut icon
      https://blog.oddbit.com/img/theme-colors/orange.png
    • stylesheet
      https://blog.oddbit.com/styles.css
    • stylesheet
      https://blog.oddbit.com/style.css

Links

15