I think the better solution would be to get rid of print() and sscanf().
Here is what the ISO CPP saying about using <cstdio>

https://isocpp.org/wiki/faq/input-output#iostream-vs-stdio

More type-safe: With <iostream>, the type of object being I/O?d is known
statically by the compiler. In contrast, <cstdio> uses "%" fields to
figure out the types dynamically.
Less error prone: With <iostream>, there are no redundant "%" tokens that
have to be consistent with the actual objects being I/O?d. Removing
redundancy removes a class of errors.
Extensible: The C++ <iostream> mechanism allows new user-defined types to
be I/O?d without breaking existing code. Imagine the chaos if everyone was
simultaneously adding new incompatible "%" fields to printf() and scanf()
?!
Inheritable: The C++ <iostream> mechanism is built from real classes such
as std::ostream and std::istream. Unlike <cstdio>?s FILE*, these are real
classes and hence inheritable. This means you can have other user-defined
things that look and act like streams, yet that do whatever strange and
wonderful things you want. You automatically get to use the zillions of
lines of I/O code written by users you don?t even know, and they don?t
need to know about your ?extended stream? class.

I think today there is no real reason to use <cstdio> instead of
<iostream>.


Julian Rehborn
Junior Software Engineer
________________________________________
GBS PAVONE Groupware GmbH
Im Dörener Feld 3
33100 Paderborn
Germany
Phone: +49 52 51 31 02-0
Fax: +49 52 51 31 02-99
www.pavone.de
________________________________________



--
GBS PAVONE Groupware GmbH Disclaimer
automatically added by GBS Email Management Solutions

Sitz der Gesellschaft:
GBS PAVONE Groupware GmbH
Hospitalstr. 6
99817 Eisenach
Germany

Webseite: http://www.pavone.de, E-Mail: i...@pavone.de

Registereintragung: Amtsgericht Jena HRB 508241
Umsatzsteuer-Identifikations-Nummer gemäß Paragraph 27a UstG: DE 185612304
Geschäftsführer: Jörg Ott






From:   Matthew Brincke <mabr...@ymail.com>
To:     "podofo-us...@lists.sf.net" <podofo-us...@lists.sf.net>
Date:   22.04.2016 00:58
Subject:        [Podofo-users] Getting rid of warnings about
printf()/sscanf()       format strings



Hi all,

I'd like to submit a patch for that (-Wformat= warnings),
but I think I should ask you about the course to take:
correct the format strings (I'd omit those concerning
pdf_long values, that's another matter, I think, because
AFAIK pdf_long is deprecated/should be removed anyway,
in a separate commit, of course) or get rid of printf()
and sscanf() at least in these cases by replacing them
with the correct iostream (cout for printf()) operations?

Thanks in advance.

Best regards, mabri

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications
Manager
Applications Manager provides deep performance insights into multiple
tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to