User forums > General (but related to Code::Blocks)

#ifdef #else #endif problem

(1/1)

dirk_1980:
Hi,
i am looking for a new IDE for me and i found CB.

So i'm new to CB (April 3 2009) and i have only 2 problems.

1.
How can i tell CB to analyse #ifdef #else #endif and ignore the undefined part?

It is impossible for me to see what ist going on in my Code.
Even CB can't find all Functions.

2.
How can i tell CB to make a backup when i save a File (not Autosave after x minutes)?

Dirk

 

dirk_1980:
Hi,

this is really interesting.
Anybody is using #idef but no one cares about:
- several declarations of variables or functions
- different code for test or customer versions (in one file)

#define customer_a
//#define customer_b
//#define LED
#define LCD

#ifdef customer_a
#ifdef LED
#define MAX 12
unsigned char Test;
#else
#define MAX 10
signed char Test;
#endif
#else
#ifdef LED
#define MAX 21
unsigned long Test;
#else
#define MAX 19
signed short Test;
#endif
#endif


Test is what type ?
MAX is ?

And this is just a easy example.


It's also interessant that never someone was mising a automatical backup.

Dirk

Biplab:
1. C::B doesn't have a good pre-processor parser. So #ifdef support is incomplete.
2. Settings > Environment > Autosave > Method > Create backup and save to original file.

dirk_1980:
1. is there a editor with better pre-processor parser or is this somthing what is comming to C::B ?

2. this is only working with autosave after x minutes and not with SAVE (Ctrl-S)
Dirk

Navigation

[0] Message Index

Go to full version