コーディングスタイルを再考します...

gccソースファイルlibcpp / files.cからの抜粋

Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  1. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  2. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  3. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  4. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  5. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  6. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  7. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  8. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  9. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  10. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  11. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  12. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  13. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;
  14. Copy Source | Copy HTML /* off_t might have a wider range than ssize_t - in other words, the max size of a file might be bigger than the address space. We can't handle a file that large. (Anyone with a single source file bigger than 2GB needs to rethink their coding style.) Some systems (eg AIX 4.1) define SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large" , file->path); return false ; } size = file->st.st_size;


Source: https://habr.com/ru/post/J52082/


All Articles