xref, cxref, any crossref command?

decuser

Active Member

Reaction score: 72
Messages: 204

Is there something similar to xref or cxref for the source code in FreeBSD? I used cscope which isn't bad, but that seems to be purely interactive. I'd like to be able to create a listing of cross references that I can print out and study.
 
Last edited by a moderator:
OP
decuser

decuser

Active Member

Reaction score: 72
Messages: 204

I found cxref in ports and tried it out, but it requires gcc which I'm not keen on adding to the system if I can avoid it.
 

mark_j

Aspiring Daemon

Reaction score: 484
Messages: 883

I found cxref in ports and tried it out, but it requires gcc which I'm not keen on adding to the system if I can avoid it.
It does? Is that as a package? It's probably saying that in the configure script, when in reality it's only looking for cc. Build it from source.
Specify on the command line of cxref -CPP clang and you're fine.
 
OP
decuser

decuser

Active Member

Reaction score: 72
Messages: 204

Yeah, a ./configure without gcc installed 'worked.' Unfortunately, cxref doesn't know what a _Noreturn is and doesn't work so good on FreeBSD:

Code:
cxref src/cxref.c
/usr/include/stdlib.h:86: cxref: syntax error

The previous 10, current and next 10 symbols are:
  0 | 291 : void
  1 | 257 : abort
  2 |  40 : (
  3 | 291 : void
  4 |  41 : )
  5 |  59 : ;
  6 | 295 : int
  7 | 257 : abs
  8 |  40 : (
  9 | 295 : int
 10 |  41 : )
 

mark_j

Aspiring Daemon

Reaction score: 484
Messages: 883

And this is solely a FreeBSD issue?
This is OLD software, not even supported in the ports. Perhaps look for alternatives, ie, Crange
 
OP
decuser

decuser

Active Member

Reaction score: 72
Messages: 204

Yup, that's why I asked the question. Crange and crtags look like they might just fit the bill. Thanks.
 
Top