Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3602 closed Bugs (fixed)

created pch.cpp file is missing a terminating newline.

Reported by: Paul A. Bristow Owned by: Vladimir Prus
Milestone: Boost 1.42.0 Component: build
Version: Boost Development Trunk Severity: Problem
Keywords: missing newline /Za pch.cpp Cc:

Description

In Boost.math testing

cpp-pch pch : pch.hpp : <use>../../test/buildboost_test_exec_monitor ;

writes a file pch.pch.cpp that is missing a terminating newline. "fatal error C1004: unexpected end-of-file found"

#include "pch.hpp"


This is required in strict C++ compliance mode /Za.

compile-c-c++-pch ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch pch.pch.cpp ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch.cpp(1) : fatal error C1004: unexpected end-of-file found

call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul

cl /Zm800 -nologo @"..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch.rsp" "..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch.cpp"

...failed compile-c-c++-pch ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.obj...

Attachments (1)

msvc.diff (760 bytes ) - added by Vladimir Prus 13 years ago.

Download all attachments as: .zip

Change History (6)

by Vladimir Prus, 13 years ago

Attachment: msvc.diff added

comment:1 by Vladimir Prus, 13 years ago

Paul, does the attached patch help? Please note you need current Boost.Jam -- you can get that by running 'bootstrap.bat' in the root of boost source tree.

comment:2 by Vladimir Prus, 13 years ago

Status: newassigned

comment:3 by anonymous, 13 years ago

Sadly not quite

pch.pch.cpp ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch.cpp(1) : warning C4067: unexpected tokens following preprocessor directive - expected a newline ..\..\..\bin.v2\libs\math\test\msvc-9.0\debug\asynch-exceptions-on\threading-multi\pch.pch.cpp(1) : fatal error C1004: unexpected end-of-file found

pch.pch.cpp contains:

#include "pch.hpp"\n

So isn't translating the \n into a newline :-(

(using bjam 3.1.17 I believe

comment:4 by Vladimir Prus, 13 years ago

Resolution: fixed
Status: assignedclosed

(In [57965]) When generating PCH-compiling cpp, end it with newline.

Fixes #3602.

in reply to:  4 comment:5 by Paul A. Bristow, 13 years ago

Replying to vladimir_prus:

(In [57965]) When generating PCH-compiling cpp, end it with newline.

Fixes #3602.

Confirms Works OK for me with jamfile including requirements

<toolset>msvc:<cxxflags>/Za # disable MS Extensions in Boost.Test

cpp-pch pch : pch.hpp : <use>../../test/buildboost_test_exec_monitor ;

that failed before.

Thanks.

Note: See TracTickets for help on using tickets.