dave kellogg

'__FILE__" Expansion should not include the path

Discussion created by dave kellogg on Jan 5, 2010
Latest reply on Jan 8, 2010 by Tom Thompson

I'm using CodeWarrior v5.0 for the S12X, on Windows XP.

 

I use the predefined "__FILE__" macro to build an ASSERT macro of my own.

 

The problem is that __FILE__ is replaced by the file name ***plus the file's entire path***.  This means that if I build my project in two different directories, I will have different load images (because the text contains the path).  This causes a lot of difficulty when different team members rebuild in different working directories, and get differing load images from the same exact source files.

 

Has anyone discovered a way to suppress the path in the __FILE__ macro, so it expands to only the file name and extension?

Outcomes