Having unraveled the use of longjmp here, the jmp_buf and its setup are no
longer required.
On GCC 8.3.0 this removes a -Wclobbered warning. Though interestingly the
warning text itself is a false positive, referencing nverts that is not used in
the setjmp(…)!=0 path. The actual dangerously used variables in this scenario
were polygon_list and vertex_list. My take away here is that *any* -Wclobbered
warning is typically an indicator of incorrect code. I have never seen a
-Wclobbered warning (from any compiler) for code that was not buggy.
Related to #1801.
#include <math.h>
#include <neatogen/neato.h>
#include <pathplan/pathutil.h>
-#include <setjmp.h>
-
-static jmp_buf jbuf;
#define MAXINTS 10000 /* modify this line to reflect the max no. of
intersections you want reported -- 50000 seems to break the program */
input.nvertices = nverts;
input.npolygons = n_polys;
- if (setjmp(jbuf)) {
- free(polygon_list);
- free(vertex_list);
- return 0;
- }
found = find_ints(vertex_list, polygon_list, &input, ilist);
if (found < 0) {
free(polygon_list);