Report
4 years, 9 months ago.

#pragma once in SerialPipe.cpp

Hi,

Maybe this just shows my ignorance about c++ but what does the #pragma once mean in SerialPipe.cpp.

As far as I understand it is used in header files to prevent multiple inclusion. Is this meant to be here? If so what does it do?

Thanks in advance Richard

Question relating to:

support library for C027 helper functions for Buffer Pipes, Buffered Serial Port (rtos capable) and GPS parsing. It includes modem APIs for USSD, SMS and Sockets. C027, u-blox

http://infocenter.arm.com/help/topic/com.arm.doc.dui0491c/DUI0491C_arm_compiler_reference.pdf section 5.91 - as you say for header files usually though...

posted by D J 17 Dec 2014

as i said it can be removed. it is not needed.

posted by Michael Ammann 17 Dec 2014
Comment on this question

1 Answer

4 years, 9 months ago.

it is a multiple header inclusion guard.

http://en.m.wikipedia.org/wiki/Pragma_once

its a left over, we can remove.

Hi Michael, I can very much understand why it has been put in SerialPipe.h but I was just wondering why it was in SerialPipe.cpp as well, and if this was intentional.

posted by Richard Osterloh 17 Dec 2014