Page MenuHomePhabricator

printf and sprintf header not included in some code
Closed, ResolvedPublic

Description

OS: Fedora release 11 (Leonidas)
GCC: 4.4.0 20090506 (Red Hat 4.4.0-4)
There are some printf and sprintf in
mitk/Modules/GPGPU/mitkGPGPU.cpp line 300
mitk/Modules/IGT/IGTTrackingDevices/mitkNDIProtocol.cpp line 225,386,398
mitk/Modules/IGT/IGTTrackingDevices/mitkNDITrackingDevice.cpp line 320
mitk/Modules/IGT/IGTTrackingDevices/mitkClaronInterfaceStub.cpp line 25,35,40,...

Due to no stdio.h include, it will generate compiling error.

Event Timeline

This also affects the dashboard. I already informed Markus F about the GPGPU code. @Jochen: can you please find someone for the IGT classes. (s)printf usually is considered deprecated in c++. Maybe it can be changed to the new logging classes.

I fixed the IGT classes in revision #18312. For the NDI classes, I added the missing include, because they use sprintf to construct complex strings to send/receive over the serial interface. It would be more complicated to emulate this with c++ streams. There is no security risk, as no user input is handled with these code. I replaced all printf calls with our logging interface in the mitkClaronInterfaceStub.cpp file.
I'll move this bug now to Markus for the GPGPU fixes.

mitkGPGPU printfs are replaced, closing bug