Sorry, it was my fault. I used the command in the wrong shell, where $DIR was not defined, and it couldn't write the file. If DIR is defined, it's just fine... The "perhaps because no tags were found" put off of my head the possibility that was just a permissions problem. With tagparser == C, cuda headers are fine.
For standard library, to make it work without -P I had to do:
CFLAGS="-D__GXX_EXPERIMENTAL_CXX0X__ -I/usr/include/c++/4.5/ -I/usr/include/c++/4.5/bits" \ geany -g $DIR/geany-stdlib.c.tags /usr/include/std*.h $SELECTED_CPP_HEADERS
with
SELECTED_CPP_HEADERS=$( find /usr/include/c++/4.5 -maxdepth 1 -type f | tr '\n' ' ' )
Explanation: if I just use "/usr/include/c++/4.5/*", geany tries to open the "backwards" directory in /usr/include/c++/4.5 as it was a file and returns an error; that "find" command excludes directories and list files in one row, so that dirs are purged. The "-D__GXX_EXPERIMENTAL_CXX0X__" was by analyzing tgmath.h. Without it, I get this:
--- /usr/include/tgmath.h:245: error: #error "Unsupported compiler; you cannot use <tgmath.h>" --- So it's kind of making tgmath believe it's a normal compiler preprocessing. But I couldn't make it work for "/usr/include/*.h" instead of "/usr/include/std*.h", due to continuous include errors (I finally get a missing ioccom.h, and there is no package providing it). Or should just give up and use -P instead?
Eugenio