model.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. /* Coverity Scan model
  4. *
  5. * This is a modeling file for Coverity Scan. Modeling helps to avoid false
  6. * positives.
  7. *
  8. * - A model file can't import any header files.
  9. * - Therefore only some built-in primitives like int, char and void are
  10. * available but not wchar_t, NULL etc.
  11. * - Modeling doesn't need full structs and typedefs. Rudimentary structs
  12. * and similar types are sufficient.
  13. * - An uninitialized local pointer is not an error. It signifies that the
  14. * variable could be either NULL or have some data.
  15. *
  16. * Coverity Scan doesn't pick up modifications automatically. The model file
  17. * must be uploaded by an admin in the analysis settings of
  18. * https://scan.coverity.com/projects/urho3d-urho3d?tab=analysis_settings
  19. */
  20. #define URHO3D_API __attribute__((visibility("default")))
  21. namespace Urho3D
  22. {
  23. // Suppressing false positive due to (ARRAY_VS_SINGLETON) out-of-bound access
  24. //
  25. // FIXME: For some reasons below does not work, probably it generated a different mangled name than the one it supposes to replace
  26. //
  27. class URHO3D_API VectorBase {};
  28. template <class T> class Vector : public VectorBase
  29. {
  30. public:
  31. void Push(const T& value)
  32. {
  33. T array[] = {value};
  34. Resize(size_ + 1, array);
  35. }
  36. };
  37. }