Skip to content

Fix pointer conversion errors reported by CLang 15/16#459

Closed
Diviloper wants to merge 1 commit intoMobilityDB:masterfrom
Diviloper:pointer-errors
Closed

Fix pointer conversion errors reported by CLang 15/16#459
Diviloper wants to merge 1 commit intoMobilityDB:masterfrom
Diviloper:pointer-errors

Conversation

@Diviloper
Copy link
Copy Markdown
Member

This PR fixes three pointer conversion errors that were reported during compilation of the MEOS library in the macOS env of the conda PR, which uses CLang 16.
They were not being reported because these int-conversion errors were only "upgraded" to default errors in CLang 15 (see release notes, third to last bullet point)

@Diviloper Diviloper marked this pull request as ready for review March 25, 2024 17:42
@Diviloper
Copy link
Copy Markdown
Member Author

Said pointer errors:

[ 99%] Building C object meos/postgis/liblwgeom/CMakeFiles/liblwgeom.dir/lwin_wkt_parse.c.o
2024-03-25T09:36:27.1010010Z [ 99%] Built target common
2024-03-25T09:36:30.5196600Z [ 99%] Built target ryu
2024-03-25T09:36:30.5397800Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/work/meos/postgres/utils/formatting.c:3313:14: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'TimestampTz' (aka 'long') [-Wint-conversion]
2024-03-25T09:36:30.5506200Z       return NULL;
2024-03-25T09:36:30.5613250Z              ^~~~
2024-03-25T09:36:30.5726110Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/_build_env/lib/clang/16/include/stddef.h:89:16: note: expanded from macro 'NULL'
2024-03-25T09:36:30.5828200Z #  define NULL ((void*)0)
2024-03-25T09:36:30.5955600Z                ^~~~~~~~~~
2024-03-25T09:36:30.6074830Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/work/meos/postgres/utils/formatting.c:3322:12: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'TimestampTz' (aka 'long') [-Wint-conversion]
2024-03-25T09:36:30.6176860Z     return NULL;
2024-03-25T09:36:30.6279890Z            ^~~~
2024-03-25T09:36:30.6384160Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/_build_env/lib/clang/16/include/stddef.h:89:16: note: expanded from macro 'NULL'
2024-03-25T09:36:30.6486680Z #  define NULL ((void*)0)
2024-03-25T09:36:30.6588600Z                ^~~~~~~~~~
2024-03-25T09:36:30.6690990Z 2 errors generated.
2024-03-25T09:36:30.6804930Z make[2]: *** [meos/postgres/utils/CMakeFiles/utils.dir/build.make:118: meos/postgres/utils/CMakeFiles/utils.dir/formatting.c.o] Error 1
2024-03-25T09:36:30.6912250Z make[2]: *** Waiting for unfinished jobs....
2024-03-25T09:36:30.7030610Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/work/meos/postgres/utils/datetime.c:4403:25: error: incompatible pointer to integer conversion passing 'char[30]' to parameter of type 'int' [-Wint-conversion]
2024-03-25T09:36:30.7130620Z       meos_error(ERROR, "time zone \"%s\" not recognized", dtza->zone);
2024-03-25T09:36:30.7244930Z                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-03-25T09:36:30.7348120Z /Users/runner/Miniforge3/conda-bld/meos_1711359053084/work/meos/postgres/utils/../../include/meos.h:330:42: note: passing argument to parameter 'errcode' here
2024-03-25T09:36:30.7451080Z extern void meos_error(int errlevel, int errcode, char *format, ...);
2024-03-25T09:36:30.7551570Z                                          ^
2024-03-25T09:36:30.7654160Z 1 error generated.
2024-03-25T09:36:30.7755410Z make[2]: *** [meos/postgres/utils/CMakeFiles/utils.dir/build.make:90: meos/postgres/utils/CMakeFiles/utils.dir/datetime.c.o] Error 1
2024-03-25T09:36:31.9807210Z make[1]: *** [CMakeFiles/Makefile2:1244: meos/postgres/utils/CMakeFiles/utils.dir/all] Error 2
2024-03-25T09:36:31.9908980Z make[1]: *** Waiting for unfinished jobs....
2024-03-25T09:36:33.2357850Z [ 99%] Built target port
2024-03-25T09:36:36.9074090Z [ 99%] Built target general_meos
2024-03-25T09:36:39.1707950Z [ 99%] Built target timezone
2024-03-25T09:36:41.2130170Z [ 99%] Built target general
2024-03-25T09:36:42.7139350Z [ 99%] Built target point
2024-03-25T09:36:42.7160390Z [ 99%] Built target liblwgeom
2024-03-25T09:36:42.7172430Z make: *** [Makefile:146: all] Error 2
2024-03-25T09:36:42.9468990Z Traceback (most recent call last):
2024-03-25T09:36:42.9469810Z   File "/Users/runner/work/1/s/.ci_support/build_all.py", line 231, in <module>
2024-03-25T09:36:42.9471850Z     build_all(os.path.join(root_dir, "recipes"), args.arch)
2024-03-25T09:36:42.9473510Z   File "/Users/runner/work/1/s/.ci_support/build_all.py", line 121, in build_all
2024-03-25T09:36:42.9474020Z     build_folders(recipes_dir, folders, arch, channel_urls)
2024-03-25T09:36:42.9474950Z   File "/Users/runner/work/1/s/.ci_support/build_all.py", line 177, in build_folders
2024-03-25T09:36:42.9476100Z     conda_build.api.build([recipe], config=get_config(arch, channel_urls))
2024-03-25T09:36:42.9476920Z   File "/Users/runner/Miniforge3/lib/python3.10/site-packages/conda_build/api.py", line 254, in build
2024-03-25T09:36:42.9505720Z     return build_tree(
2024-03-25T09:36:42.9506740Z   File "/Users/runner/Miniforge3/lib/python3.10/site-packages/conda_build/build.py", line 3789, in build_tree
2024-03-25T09:36:42.9517320Z     packages_from_this = build(
2024-03-25T09:36:42.9518390Z   File "/Users/runner/Miniforge3/lib/python3.10/site-packages/conda_build/build.py", line 2670, in build
2024-03-25T09:36:42.9523650Z     utils.check_call_env(
2024-03-25T09:36:42.9524430Z   File "/Users/runner/Miniforge3/lib/python3.10/site-packages/conda_build/utils.py", line 435, in check_call_env
2024-03-25T09:36:42.9529670Z     return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
2024-03-25T09:36:42.9530830Z   File "/Users/runner/Miniforge3/lib/python3.10/site-packages/conda_build/utils.py", line 411, in _func_defaulting_env_to_os_environ
2024-03-25T09:36:42.9532550Z     raise subprocess.CalledProcessError(proc.returncode, _args)
2024-03-25T09:36:42.9533510Z subprocess.CalledProcessError: Command '['/bin/bash', '-o', 'errexit', '/Users/runner/Miniforge3/conda-bld/meos_1711359053084/work/conda_build.sh']' returned non-zero exit status 2.
2024-03-25T09:37:00.4625670Z 
2024-03-25T09:37:00.4730720Z ##[error]Bash exited with code '1'.
2024-03-25T09:37:00.4817370Z ##[section]Finishing: Run OSX build

@mschoema
Copy link
Copy Markdown
Member

This looks good, but you should make this PR on the develop branch instead of master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants