From c54f632a8899d6e363e47e5258979ed08c1be32b Mon Sep 17 00:00:00 2001 From: Nathan Foster Date: Sat, 5 Apr 2025 14:40:21 +0100 Subject: [PATCH] Move warnings using std::printf to std::cerr Warnings should not be in stdout. Warning messages should be unchanged, but should be in stderr instead of stdout. #1625 --- src/object/sp-clippath.cpp | 7 +++---- src/object/sp-mask.cpp | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/object/sp-clippath.cpp b/src/object/sp-clippath.cpp index 0b1b1bafa7..2b86edc41d 100644 --- a/src/object/sp-clippath.cpp +++ b/src/object/sp-clippath.cpp @@ -308,10 +308,9 @@ bool SPClipPathReference::_acceptObject(SPObject *obj) const obj_name = obj_repr->name(); obj_id = obj_repr->attribute("id"); } - std::printf("WARNING: Ignoring recursive clippath reference " - "<%s clippath=\"%s\"> in <%s id=\"%s\">", - owner_name, owner_clippath, - obj_name, obj_id); + std::cerr << "WARNING: Ignoring recursive clippath reference " + << "<" << (owner_name ? owner_name : "(null)") << " clippath=\"" << (owner_clippath ? owner_clippath : "(null)") << "\">" + << " in <" << (obj_name ? obj_name : "(null)") << " id=\"" << (obj_id ? obj_id : "(null)") << "\">" << std::endl; return false; } diff --git a/src/object/sp-mask.cpp b/src/object/sp-mask.cpp index b0f7fd94a5..17363f9fa5 100644 --- a/src/object/sp-mask.cpp +++ b/src/object/sp-mask.cpp @@ -289,10 +289,9 @@ bool SPMaskReference::_acceptObject(SPObject *obj) const obj_name = obj_repr->name(); obj_id = obj_repr->attribute("id"); } - std::printf("WARNING: Ignoring recursive mask reference " - "<%s mask=\"%s\"> in <%s id=\"%s\">", - owner_name, owner_mask, - obj_name, obj_id); + std::cerr << "WARNING: Ignoring recursive mask reference " + << "<" << (owner_name ? owner_name : "(null)") << " mask=\"" << (owner_mask ? owner_mask : "(null)") << "\">" + << " in <" << (obj_name ? obj_name : "(null)") << " id=\"" << (obj_id ? obj_id : "(null)") << "\">" << std::endl; return false; } -- GitLab