Re: cpp behavior?

From: Ian Lepore <ian_at_freebsd.org>
Date: Sat, 20 May 2017 11:39:14 -0600
On Fri, 2017-05-19 at 17:07 -0700, Steve Kargl wrote:
> % which cpp
> /usr/bin/cpp
> troutmask:kargl[408] cpp --version
> FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on
> LLVM 4.0.0)
> Target: x86_64-unknown-freebsd12.0
> Thread model: posix
> InstalledDir: /usr/bin
> troutmask:kargl[409] cpp --help |grep trad
>   -traditional-cpp        Enable some traditional CPP emulation
> troutmask:kargl[410] cpp -traditional-cpp boxmuller.F90 
> cpp: error: unable to execute command: Executable "gcc" doesn't
> exist!
> 
> OK, so what is the preprocessor for clang?
> 

It looks like the problem is that it sees the .F90 and wants to "do the
right thing" for fortran sources, which is "invoke gcc".  I got a clue
by adding '-###' (quotes required) to see what cpp was trying to do
internally.

You might get the effect you want by either adding something like -x
assembler-with-cpp, or maybe by hiding the filetype from cpp:

 cat boxmuller.F90 | cpp -traditional-cpp

-- Ian
Received on Sat May 20 2017 - 15:39:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC