[cups] [PATCH] scheduler/type: debug_ops[] is out of sync

Brian Norris computersforpeace at gmail.com
Wed Mar 16 12:31:52 PDT 2016


Hi,

I'd report a new bug, but the bug tracker is down for maintenance.

Since the addition of MIME_MAGIC_REGEX, the debug_ops[] array is out of
sync with the mime_op_t enum. This causes segfaults when using
--enable-debug-printfs. Attaching a patch to fix this.

It'd be best if we could use the compiler to our advantage to catch
these types of errors (e.g., introduce some kind of compile-time
assertion;, or use a switch/case without a 'default' instead of an
array, since many compilers would warn about the unused enum), but I
didn't really want to refactor this all for a bugfix. I'm also not as
familiar with the non-Linux systems that CUPS is built for, so I'm not
sure what (if any) C99 features I could use, for instance.

Regards,
Brian


More information about the cups mailing list