CS 3733 Operating Systems, Spring 2004 Assignment 0 Comments

These comments refer the the valid_program_line function:

  1. Check all characters for validity
  2. avoid unusual constructs
  3. avoid unusual arguments
  4. understand the meaning of NULL
  5. avoid defining your own macros
  6. avoid using the is-macros
  7. avoid hard coding of ASCII values
  8. avoid else after return
  9. never include tab characters in character or string constants
  10. avoid excessive indentation
  11. avoid code that has no effect
  12. at most one statement per line
  13. The null character is not any different from other invalid characters
  14. If you use a finite state machine (FSM) solution, define the states
  15. avoid obscure programming
  16. avoid C++ type comments in C source
  17. use proper indentation
Testing Some cases to test for: