Task #81908 - spglib-2.6.0-1.20251111055537843828.develop.47.g21e8a26/scan-results.err
back to task #81908download
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/python/py_bindings.cpp: scope_hint: In function ‘std::optional<pybind11::dict> spglib::layer_dataset(array_double, array_double, array_int, pybind11::int_, pybind11::float_)’
spglib-2.6.0/python/py_bindings.cpp:264:41: warning[-Wdeprecated-declarations]: ‘SpglibDataset* spg_get_layer_dataset(const double (*)[3], const double (*)[3], const int*, int, int, double)’ is deprecated: Experimental interface. May be removed in next major release.
# 264 | if ((dataset = spg_get_layer_dataset(
# | ~~~~~~~~~~~~~~~~~~~~~^
# 265 | (double (*)[3])lattice.data(), (double (*)[3])positions.data(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 266 | atom_types.data(), atom_types.size(), aperiodic_dir, symprec)) ==
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/python/py_bindings.cpp:4: included_from: Included from here.
spglib-2.6.0/include/spglib.h:212:24: note: declared here
# 212 | SPG_API SpglibDataset *spg_get_layer_dataset(
# | ^~~~~~~~~~~~~~~~~~~~~
# 262| py::float_ symprec) {
# 263| SpglibDataset *dataset;
# 264|-> if ((dataset = spg_get_layer_dataset(
# 265| (double (*)[3])lattice.data(), (double (*)[3])positions.data(),
# 266| atom_types.data(), atom_types.size(), aperiodic_dir, symprec)) ==
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/python/py_bindings.cpp: scope_hint: In function ‘std::optional<pybind11::int_> spglib::symmetry(array_int, array_double, array_double, array_double, array_int, pybind11::float_, pybind11::float_)’
spglib-2.6.0/python/py_bindings.cpp:375:30: warning[-Wdeprecated-declarations]: ‘int spgat_get_symmetry(int (*)[3][3], double (*)[3], int, const double (*)[3], const double (*)[3], const int*, int, double, double)’ is deprecated: Use the variables from SpglibDataset (rotations, translations)
# 375 | return spgat_get_symmetry(
# | ~~~~~~~~~~~~~~~~~~^
# 376 | (int (*)[3][3])rotations.mutable_data(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 377 | (double (*)[3])translations.mutable_data(), rotations.shape(0),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 378 | (double (*)[3])lattice.data(), (double (*)[3])positions.data(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 379 | atom_types.data(), atom_types.size(), symprec, angle_tolerance);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/include/spglib.h:254:13: note: declared here
# 254 | SPG_API int spgat_get_symmetry(int rotation[][3][3], double translation[][3],
# | ^~~~~~~~~~~~~~~~~~
# 373| array_double positions, array_int atom_types, py::float_ symprec,
# 374| py::float_ angle_tolerance) {
# 375|-> return spgat_get_symmetry(
# 376| (int (*)[3][3])rotations.mutable_data(),
# 377| (double (*)[3])translations.mutable_data(), rotations.shape(0),
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/python/py_bindings.cpp: scope_hint: In function ‘std::optional<pybind11::int_> spglib::hall_number_from_symmetry(array_int, array_double, pybind11::float_)’
spglib-2.6.0/python/py_bindings.cpp:511:45: warning[-Wdeprecated-declarations]: ‘int spg_get_hall_number_from_symmetry(const int (*)[3][3], const double (*)[3], int, double)’ is deprecated: Use the variable from SpglibSpacegroupType instead (hall_number)
# 511 | return spg_get_hall_number_from_symmetry((int (*)[3][3])rotations.data(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 512 | (double (*)[3])translations.data(),
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 513 | rotations.shape(0), symprec);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/include/spglib.h:327:13: note: declared here
# 327 | SPG_API int spg_get_hall_number_from_symmetry(int const rotation[][3][3],
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 509| std::optional<py::int_> spglib::hall_number_from_symmetry(
# 510| array_int rotations, array_double translations, py::float_ symprec) {
# 511|-> return spg_get_hall_number_from_symmetry((int (*)[3][3])rotations.data(),
# 512| (double (*)[3])translations.data(),
# 513| rotations.shape(0), symprec);
Error: GCC_ANALYZER_WARNING (CWE-688):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c: scope_hint: In function ‘main’
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:205:31: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
<built-in>: note: argument 2 of ‘__builtin_strstr’ must be non-null
# 203| for (i = 0; i < NumTests && testToRun == -1; ++i) {
# 204| char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
# 205|-> if (partial_match != 0 && strstr(test_name, arg) != CM_NULL) { /* NOLINT */
# 206| testToRun = i;
# 207| ac -= 2;
Error: GCC_ANALYZER_WARNING (CWE-688):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:205:31: warning[-Wanalyzer-null-argument]: use of NULL ‘lowercase(cmakeGeneratedFunctionMapEntries[i].name)’ where non-null expected
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
<built-in>: note: argument 1 of ‘__builtin_strstr’ must be non-null
# 203| for (i = 0; i < NumTests && testToRun == -1; ++i) {
# 204| char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
# 205|-> if (partial_match != 0 && strstr(test_name, arg) != CM_NULL) { /* NOLINT */
# 206| testToRun = i;
# 207| ac -= 2;
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:205:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:4: included_from: Included from here.
/usr/include/string.h:357:14: note: argument 1 of ‘strstr’ must be a pointer to a null-terminated string
# 203| for (i = 0; i < NumTests && testToRun == -1; ++i) {
# 204| char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
# 205|-> if (partial_match != 0 && strstr(test_name, arg) != CM_NULL) { /* NOLINT */
# 206| testToRun = i;
# 207| ac -= 2;
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:205:31: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*arg’
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
/usr/include/string.h:357:14: note: argument 2 of ‘strstr’ must be a pointer to a null-terminated string
# 203| for (i = 0; i < NumTests && testToRun == -1; ++i) {
# 204| char *test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
# 205|-> if (partial_match != 0 && strstr(test_name, arg) != CM_NULL) { /* NOLINT */
# 206| testToRun = i;
# 207| ac -= 2;
Error: GCC_ANALYZER_WARNING (CWE-688):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:209:38: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
/usr/include/string.h:163:12: note: argument 2 of ‘strcmp’ must be non-null
# 207| ac -= 2;
# 208| av += 2;
# 209|-> } else if (partial_match == 0 && strcmp(test_name, arg) == 0) {
# 210| testToRun = i;
# 211| ac--;
Error: GCC_ANALYZER_WARNING (CWE-688):
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:209:38: warning[-Wanalyzer-null-argument]: use of NULL ‘lowercase(cmakeGeneratedFunctionMapEntries[i].name)’ where non-null expected
spglib-2.6.0/redhat-linux-build/test/functional/fortran/fortran_test.c:35:38: note: in definition of macro ‘CM_CAST’
/usr/include/string.h:163:12: note: argument 1 of ‘strcmp’ must be non-null
# 207| ac -= 2;
# 208| av += 2;
# 209|-> } else if (partial_match == 0 && strcmp(test_name, arg) == 0) {
# 210| testToRun = i;
# 211| ac--;
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/cell.c: scope_hint: In function ‘cel_free_cell’
spglib-2.6.0/src/cell.c:96:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*cell.position’
# 94| cell->lattice = NULL;
# 95| }
# 96|-> if (cell->position != NULL) {
# 97| free(cell->position);
# 98| cell->position = NULL;
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/cell.c:104:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*cell.tensor_rank’
# 102| cell->types = NULL;
# 103| }
# 104|-> if ((cell->tensor_rank != NOSPIN) && (cell->tensors != NULL)) {
# 105| // When cell->tensor_rank==NOSPIN, cell->tensors is already
# 106| // NULL.
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/cell.c:104:51: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*cell.tensors’
# 102| cell->types = NULL;
# 103| }
# 104|-> if ((cell->tensor_rank != NOSPIN) && (cell->tensors != NULL)) {
# 105| // When cell->tensor_rank==NOSPIN, cell->tensors is already
# 106| // NULL.
Error: CPPCHECK_WARNING (CWE-457):
spglib-2.6.0/src/delaunay.c:95: warning[uninitvar]: Uninitialized variable: succeeded
# 93| }
# 94|
# 95|-> if (!succeeded) {
# 96| goto err;
# 97| }
Error: CPPCHECK_WARNING (CWE-457):
spglib-2.6.0/src/delaunay.c:388: warning[uninitvar]: Uninitialized variable: succeeded
# 386| }
# 387|
# 388|-> if (!succeeded) {
# 389| goto err;
# 390| }
Error: GCC_ANALYZER_WARNING (CWE-476):
spglib-2.6.0/src/kpoint.c: scope_hint: In function ‘get_point_group_reciprocal_with_q’
spglib-2.6.0/src/kpoint.c:358:61: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rot_reciprocal’
# 356| num_rot = 0;
# 357|
# 358|-> if ((ir_rot = (int *)malloc(sizeof(int) * rot_reciprocal->size)) == NULL) {
# 359| warning_memory("ir_rot");
# 360| return NULL;
Error: CPPCHECK_WARNING (CWE-457):
spglib-2.6.0/src/niggli.c:105: error[uninitvar]: Uninitialized variable: p
# 103| int succeeded;
# 104| NiggliParams *p;
# 105|-> int (*steps[8])(NiggliParams *p) = {step1, step2, step3, step4,
# 106| step5, step6, step7, step8};
# 107|
Error: GCC_ANALYZER_WARNING (CWE-401):
spglib-2.6.0/src/niggli.c: scope_hint: In function ‘get_metric’
spglib-2.6.0/src/niggli.c:485:34: warning[-Wanalyzer-malloc-leak]: leak of ‘get_transpose(M)’
# 483| for (i = 0; i < 3; i++) {
# 484| for (j = 0; j < 3; j++) {
# 485|-> M_T[i * 3 + j] = M[j * 3 + i];
# 486| }
# 487| }
Error: GCC_ANALYZER_WARNING (CWE-131):
spglib-2.6.0/src/overlap.c: scope_hint: In function ‘overlap_checker_alloc’
spglib-2.6.0/src/overlap.c:500:25: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
# 498| /* so a 'char *' is used. */
# 499| chr_blob = (char *)checker->blob;
# 500|-> checker->pos_temp_1 = (double (*)[3])(chr_blob + offset_pos_temp_1);
# 501| checker->pos_temp_2 = (double (*)[3])(chr_blob + offset_pos_temp_2);
# 502| checker->distance_temp = (double *)(chr_blob + offset_distance_temp);
Error: CPPCHECK_WARNING (CWE-457):
spglib-2.6.0/src/pointgroup.c:378: warning[uninitvar]: Uninitialized variables: pointgroup.holohedry, pointgroup.laue
# 376| }
# 377|
# 378|-> return pointgroup;
# 379| }
# 380|
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/site_symmetry.c:342: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nums_equiv_atoms
# 340| nums_equiv_atoms = (int *)malloc(sizeof(int) * conv_prim->size);
# 341| for (i = 0; i < conv_prim->size; i++) {
# 342|-> nums_equiv_atoms[i] = 0;
# 343| }
# 344|
Error: GCC_ANALYZER_WARNING (CWE-476):
spglib-2.6.0/src/site_symmetry.c: scope_hint: In function ‘set_Wyckoffs_labels’
spglib-2.6.0/src/site_symmetry.c:342:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nums_equiv_atoms’
# 340| nums_equiv_atoms = (int *)malloc(sizeof(int) * conv_prim->size);
# 341| for (i = 0; i < conv_prim->size; i++) {
# 342|-> nums_equiv_atoms[i] = 0;
# 343| }
# 344|
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/site_symmetry.c:346: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nums_equiv_atoms
# 344|
# 345| for (i = 0; i < conv_prim->size; i++) {
# 346|-> nums_equiv_atoms[equiv_atoms[i]]++;
# 347| }
# 348|
Error: COMPILER_WARNING (CWE-457):
spglib-2.6.0/src/spacegroup.c:1064:17: warning[-Wmaybe-uninitialized]: ‘num_free_axes’ may be used uninitialized
# 1064 | if (match_hall_symbol_db_ortho(origin_shift, conv_lattice,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1065 | orig_lattice, hall_number, centering,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1066 | symmetry, num_free_axes, symprec)) {
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/src/spacegroup.c: scope_hint: In function ‘search_hall_number’
spglib-2.6.0/src/spacegroup.c:996:19: note: ‘num_free_axes’ was declared here
# 996 | int is_found, num_free_axes;
# | ^~~~~~~~~~~~~
# 1062| }
# 1063|
# 1064|-> if (match_hall_symbol_db_ortho(origin_shift, conv_lattice,
# 1065| orig_lattice, hall_number, centering,
# 1066| symmetry, num_free_axes, symprec)) {
Error: COMPILER_WARNING (CWE-457):
spglib-2.6.0/src/spacegroup.c: scope_hint: In function ‘match_hall_symbol_db_monocli’
spglib-2.6.0/src/spacegroup.c:1116:51: warning[-Wmaybe-uninitialized]: ‘j’ may be used uninitialized
# 1116 | int i, check_norms, i_shortest, is_found_any, j, num_change_of_basis;
# | ^
# 1114| int const group_number, Centering const centering,
# 1115| Symmetry const *conv_symmetry, double const symprec) {
# 1116|-> int i, check_norms, i_shortest, is_found_any, j, num_change_of_basis;
# 1117| int is_found[36];
# 1118| double shortest_norm_sum, norm_sum;
Error: CPPCHECK_WARNING (CWE-786):
spglib-2.6.0/src/spacegroup.c:1219: error[negativeIndex]: Array 'all_origin_shifts[36][3]' accessed at index -1, which is out of bounds.
# 1217| }
# 1218|
# 1219|-> mat_copy_vector_d3(origin_shift, all_origin_shifts[i_shortest]);
# 1220| mat_copy_matrix_d3(conv_lattice, all_conv_lattices[i_shortest]);
# 1221| return 1;
Error: CPPCHECK_WARNING (CWE-786):
spglib-2.6.0/src/spacegroup.c:1220: error[negativeIndex]: Array 'all_conv_lattices[36][3][3]' accessed at index -1, which is out of bounds.
# 1218|
# 1219| mat_copy_vector_d3(origin_shift, all_origin_shifts[i_shortest]);
# 1220|-> mat_copy_matrix_d3(conv_lattice, all_conv_lattices[i_shortest]);
# 1221| return 1;
# 1222|
Error: CPPCHECK_WARNING (CWE-823):
spglib-2.6.0/src/spglib.c:218: error[arrayIndexOutOfBounds]: Array 'spglib_error_message[10]' accessed at index 99, which is out of bounds.
# 216|
# 217| for (i = 0; i < 100; i++) {
# 218|-> if (SPGERR_NONE == spglib_error_message[i].error) {
# 219| break;
# 220| }
Error: CPPCHECK_WARNING (CWE-401):
spglib-2.6.0/src/spin.c:182: error[memleak]: Memory leak: inv_perm
# 180|
# 181| if ((exact_cell = cel_alloc_cell(cell->size, cell->tensor_rank)) == NULL) {
# 182|-> return NULL;
# 183| }
# 184| mat_copy_matrix_d3(exact_cell->lattice, cell->lattice);
Error: CPPCHECK_WARNING (CWE-401):
spglib-2.6.0/src/spin.c:190: error[memleak]: Memory leak: inv_perm
# 188| if ((rotations_cart = (double (*)[3][3])malloc(
# 189| sizeof(double[3][3]) * magnetic_symmetry->size)) == NULL) {
# 190|-> return NULL;
# 191| }
# 192| set_rotations_in_cartesian(rotations_cart, cell->lattice,
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/spin.c: scope_hint: In function ‘spn_get_idealized_cell’
spglib-2.6.0/src/spin.c:216:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
# 214| }
# 215|
# 216|-> j = inv_perm[i]; /* p-th operation maps site-j to site-i */
# 217|
# 218| apply_symmetry_to_position(pos_tmp, cell->position[j],
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/spin.c: scope_hint: In function ‘get_symmetry_permutations’
spglib-2.6.0/src/spin.c:584:47: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘scalar’
# 582| i, scalar, j, cell->tensors[j]);
# 583| if (cell->tensor_rank == COLLINEAR &&
# 584|-> !is_zero(cell->tensors[j] - scalar, mag_symprec)) {
# 585| continue;
# 586| }
Error: COMPILER_WARNING (CWE-457):
spglib-2.6.0/src/spin.c:584:47: warning[-Wmaybe-uninitialized]: ‘scalar’ may be used uninitialized
# 584 | !is_zero(cell->tensors[j] - scalar, mag_symprec)) {
# | ~~~~~~~~~~~~~~~~~^~~~~~~~
spglib-2.6.0/src/spin.c: scope_hint: In function ‘spn_get_operations_with_site_tensors’
spglib-2.6.0/src/spin.c:533:12: note: ‘scalar’ was declared here
# 533 | double scalar;
# | ^~~~~~
# 582| i, scalar, j, cell->tensors[j]);
# 583| if (cell->tensor_rank == COLLINEAR &&
# 584|-> !is_zero(cell->tensors[j] - scalar, mag_symprec)) {
# 585| continue;
# 586| }
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/spin.c:588:60: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘vector[0]’
# 586| }
# 587| if (cell->tensor_rank == NONCOLLINEAR) {
# 588|-> diff[0] = cell->tensors[3 * j] - vector[0];
# 589| diff[1] = cell->tensors[3 * j + 1] - vector[1];
# 590| diff[2] = cell->tensors[3 * j + 2] - vector[2];
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c:527: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: copy_atoms_found
# 525| copy_atoms_found = (int *)malloc(sizeof(int) * cell->size);
# 526| for (i = 0; i < cell->size; i++) {
# 527|-> copy_atoms_found[i] = atoms_found[i];
# 528| }
# 529|
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c:531: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: copy_atoms_found
# 529|
# 530| for (initial_atom = 0; initial_atom < cell->size; initial_atom++) {
# 531|-> if (!copy_atoms_found[initial_atom]) {
# 532| continue;
# 533| }
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c:770: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: copy_atoms_found
# 768| copy_atoms_found = (int *)malloc(sizeof(int) * cell->size);
# 769| for (i = 0; i < cell->size; i++) {
# 770|-> copy_atoms_found[i] = atoms_found[i];
# 771| }
# 772|
Error: GCC_ANALYZER_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c: scope_hint: In function ‘search_layer_pure_translations’
spglib-2.6.0/src/symmetry.c:770:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘copy_atoms_found’
# 768| copy_atoms_found = (int *)malloc(sizeof(int) * cell->size);
# 769| for (i = 0; i < cell->size; i++) {
# 770|-> copy_atoms_found[i] = atoms_found[i];
# 771| }
# 772|
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c:774: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: copy_atoms_found
# 772|
# 773| for (initial_atom = 0; initial_atom < cell->size; initial_atom++) {
# 774|-> if (!copy_atoms_found[initial_atom]) {
# 775| continue;
# 776| }
Error: GCC_ANALYZER_WARNING (CWE-476):
spglib-2.6.0/src/symmetry.c:774:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘copy_atoms_found’
# 772|
# 773| for (initial_atom = 0; initial_atom < cell->size; initial_atom++) {
# 774|-> if (!copy_atoms_found[initial_atom]) {
# 775| continue;
# 776| }
Error: GCC_ANALYZER_WARNING (CWE-457):
spglib-2.6.0/src/symmetry.c:774:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
# 772|
# 773| for (initial_atom = 0; initial_atom < cell->size; initial_atom++) {
# 774|-> if (!copy_atoms_found[initial_atom]) {
# 775| continue;
# 776| }
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_dataset_access.cpp: scope_hint: In member function ‘virtual void DatasetAccess_test_spg_get_hall_number_from_symmetry_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_dataset_access.cpp:37:52: warning[-Wdeprecated-declarations]: ‘int spg_get_hall_number_from_symmetry(const int (*)[3][3], const double (*)[3], int, double)’ is deprecated: Use the variable from SpglibSpacegroupType instead (hall_number)
# 37 | hall_number = spg_get_hall_number_from_symmetry(
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
# 38 | dataset->rotations, dataset->translations, dataset->n_operations,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 39 | symprec);
# | ~~~~~~~~
spglib-2.6.0/test/functional/c/test_dataset_access.cpp:4: included_from: Included from here.
spglib-2.6.0/include/spglib.h:327:13: note: declared here
# 327 | SPG_API int spg_get_hall_number_from_symmetry(int const rotation[][3][3],
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 35| printf("hall_number = %d is found by spg_get_dataset.\n",
# 36| dataset->hall_number);
# 37|-> hall_number = spg_get_hall_number_from_symmetry(
# 38| dataset->rotations, dataset->translations, dataset->n_operations,
# 39| symprec);
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_dataset.cpp:284: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: spin_flips
# 282|
# 283| for (i = 0; i < size; i++) {
# 284|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 285| }
# 286| show_magnetic_symmetry_operations(rotations, translations, time_reversals,
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_dataset.cpp:284: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: time_reversals
# 282|
# 283| for (i = 0; i < size; i++) {
# 284|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 285| }
# 286| show_magnetic_symmetry_operations(rotations, translations, time_reversals,
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: spin_flips
# 159| time_reversals = (int *)malloc(sizeof(int *) * size);
# 160| for (i = 0; i < size; i++) {
# 161|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 162| }
# 163| SpglibMagneticSpacegroupType msgtype =
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: time_reversals
# 159| time_reversals = (int *)malloc(sizeof(int *) * size);
# 160| for (i = 0; i < size; i++) {
# 161|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 162| }
# 163| SpglibMagneticSpacegroupType msgtype =
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp: scope_hint: In member function ‘virtual void MagneticSymmetry_test_spg_get_symmetry_with_tensors_rough_symprec_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:224:28: warning[-Wdeprecated-declarations]: ‘int spg_get_symmetry(int (*)[3][3], double (*)[3], int, const double (*)[3], const double (*)[3], const int*, int, double)’ is deprecated: Use the variables from SpglibDataset (rotations, translations)
# 224 | size = spg_get_symmetry(rotations, translations, max_size, lattice,
# | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 225 | positions, types, num_atoms, symprec);
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:4: included_from: Included from here.
spglib-2.6.0/include/spglib.h:248:13: note: declared here
# 248 | SPG_API int spg_get_symmetry(int rotation[][3][3], double translation[][3],
# | ^~~~~~~~~~~~~~~~
# 222| time_reversals = (int *)malloc(sizeof(int *) * max_size);
# 223|
# 224|-> size = spg_get_symmetry(rotations, translations, max_size, lattice,
# 225| positions, types, num_atoms, symprec);
# 226| ASSERT_EQ(size, 4);
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:237: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: spin_flips
# 235|
# 236| for (i = 0; i < size; i++) {
# 237|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 238| }
# 239| show_magnetic_symmetry_operations(rotations, translations, time_reversals,
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/functional/c/test_magnetic_symmetry.cpp:237: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: time_reversals
# 235|
# 236| for (i = 0; i < size; i++) {
# 237|-> time_reversals[i] = (1 - spin_flips[i]) / 2;
# 238| }
# 239| show_magnetic_symmetry_operations(rotations, translations, time_reversals,
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_spacegroup_type_search.cpp: scope_hint: In member function ‘virtual void SpacegroupTypeSearch_test_spg_get_international_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_spacegroup_type_search.cpp:20:30: warning[-Wdeprecated-declarations]: ‘int spg_get_international(char*, const double (*)[3], const double (*)[3], const int*, int, double)’ is deprecated: Use the variables from SpglibDataset (spacegroup_number, international_symbol)
# 20 | spg_get_international(symbol, lattice, position, types, num_atom, 1e-5);
# | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/test/functional/c/test_spacegroup_type_search.cpp:4: included_from: Included from here.
spglib-2.6.0/include/spglib.h:368:13: note: declared here
# 368 | SPG_API int spg_get_international(char symbol[11], double const lattice[3][3],
# | ^~~~~~~~~~~~~~~~~~~~~
# 18|
# 19| num_spg =
# 20|-> spg_get_international(symbol, lattice, position, types, num_atom, 1e-5);
# 21| ASSERT_EQ(num_spg, 136);
# 22| ASSERT_STREQ(symbol, symbol_expect);
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_spacegroup_type_search.cpp: scope_hint: In member function ‘virtual void SpacegroupTypeSearch_test_spg_get_schoenflies_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_spacegroup_type_search.cpp:38:28: warning[-Wdeprecated-declarations]: ‘int spg_get_schoenflies(char*, const double (*)[3], const double (*)[3], const int*, int, double)’ is deprecated: Use the variables from SpglibDataset (spacegroup_number, international_symbol)
# 38 | spg_get_schoenflies(symbol, lattice, position, types, num_atom, 1e-5);
# | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/include/spglib.h:384:13: note: declared here
# 384 | SPG_API int spg_get_schoenflies(char symbol[7], double const lattice[3][3],
# | ^~~~~~~~~~~~~~~~~~~
# 36|
# 37| num_spg =
# 38|-> spg_get_schoenflies(symbol, lattice, position, types, num_atom, 1e-5);
# 39| ASSERT_EQ(num_spg, 136);
# 40| ASSERT_STREQ(symbol, symbol_expect);
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_symmetry_search.cpp: scope_hint: In member function ‘virtual void SymmetrySearch_test_spg_get_symmetry_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_symmetry_search.cpp:33:28: warning[-Wdeprecated-declarations]: ‘int spg_get_symmetry(int (*)[3][3], double (*)[3], int, const double (*)[3], const double (*)[3], const int*, int, double)’ is deprecated: Use the variables from SpglibDataset (rotations, translations)
# 33 | size = spg_get_symmetry(rotation, translation, max_size, lattice, position,
# | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 34 | types, num_atom, 1e-5);
# | ~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/test/functional/c/test_symmetry_search.cpp:4: included_from: Included from here.
spglib-2.6.0/include/spglib.h:248:13: note: declared here
# 248 | SPG_API int spg_get_symmetry(int rotation[][3][3], double translation[][3],
# | ^~~~~~~~~~~~~~~~
# 31|
# 32| printf("*** spg_get_symmetry (Rutile two unit cells) ***:\n");
# 33|-> size = spg_get_symmetry(rotation, translation, max_size, lattice, position,
# 34| types, num_atom, 1e-5);
# 35| ASSERT_EQ(size, 32);
Error: COMPILER_WARNING (CWE-477):
spglib-2.6.0/test/functional/c/test_symmetry_search.cpp: scope_hint: In member function ‘virtual void SymmetrySearch_test_spg_get_multiplicity_Test::TestBody()’
spglib-2.6.0/test/functional/c/test_symmetry_search.cpp:81:32: warning[-Wdeprecated-declarations]: ‘int spg_get_multiplicity(const double (*)[3], const double (*)[3], const int*, int, double)’ is deprecated: Use the variables from SpglibDataset (n_operations)
# 81 | size = spg_get_multiplicity(lattice, position, types, num_atom, 1e-5);
# | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spglib-2.6.0/include/spglib.h:354:13: note: declared here
# 354 | SPG_API int spg_get_multiplicity(double const lattice[3][3],
# | ^~~~~~~~~~~~~~~~~~~~
# 79| int size;
# 80|
# 81|-> size = spg_get_multiplicity(lattice, position, types, num_atom, 1e-5);
# 82| ASSERT_EQ(size, 48);
# 83| }
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/utils.c:156: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pos
# 154|
# 155| for (i = 0; i < num_atom; i++) {
# 156|-> pos[i][0] = position[i][0];
# 157| pos[i][1] = position[i][1];
# 158| pos[i][2] = position[i][2];
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/utils.c:157: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pos
# 155| for (i = 0; i < num_atom; i++) {
# 156| pos[i][0] = position[i][0];
# 157|-> pos[i][1] = position[i][1];
# 158| pos[i][2] = position[i][2];
# 159| typ[i] = types[i];
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/utils.c:158: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pos
# 156| pos[i][0] = position[i][0];
# 157| pos[i][1] = position[i][1];
# 158|-> pos[i][2] = position[i][2];
# 159| typ[i] = types[i];
# 160| }
Error: CPPCHECK_WARNING (CWE-476):
spglib-2.6.0/test/utils.c:159: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: typ
# 157| pos[i][1] = position[i][1];
# 158| pos[i][2] = position[i][2];
# 159|-> typ[i] = types[i];
# 160| }
# 161|
Error: GCC_ANALYZER_WARNING (CWE-476):
spglib-2.6.0/test/utils.c: scope_hint: In function ‘sub_spg_standardize_cell’
spglib-2.6.0/test/utils.c:159:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘typ’
# 157| pos[i][1] = position[i][1];
# 158| pos[i][2] = position[i][2];
# 159|-> typ[i] = types[i];
# 160| }
# 161|