[FFmpeg-devel] How to get the preprocessing result of a specific c file ?

Diego Biurrun diego
Tue Nov 24 08:43:23 CET 2009


On Sat, Nov 21, 2009 at 07:20:05PM +0800, zhihang wang wrote:
> Hi, FFmpeg friends. I have a question on getting the preprocessing result of
> a c file.
> I use the following command
> touch libavcodec/dsputil.c
> make libavcodec/dsputil.o
> I copy the outputted command the replace the GCC option -c with -E
> Then rerun the command to get the preprocessing result.
> For example: I want to use the following command to get the preprocessing
> result of dsputil.c.
> 
> gcc -DHAVE_AV_CONFIG_H -I. -I"/home/xxthink/submit_ffmpeg/new_submit/ffmpeg"
> -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64
> -D_LARGEFILE_SOURCE -std=c99 -g -Wdeclaration-after-statement -Wall
> -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls
> -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef
> -fno-math-errno -fno-signed-zeros -fno-tree-vectorize       -MMD -MF
> libavcodec/dsputil.d -MT libavcodec/dsputil.o -E -o libavcodec/dsputil.o
> libavcodec/dsputil.c
> 
> It works before, But now it doesn't work. Would someone awake like to help
> me ?Thanks a lot in advance!!!

This works fine for me.  Are you aware that you instructed gcc to put
the result of preprocessing in libavcodec/dsputil.o?  You might want to
pass another filename to the -o flag or use no -o flag and redirect
stdout.

Diego



More information about the ffmpeg-devel mailing list