Hi list,
I tend to use vim's :make command so that it takes me to the positions of warnings and errors automatically. However, when hacking on osmo-iuh, I sometimes get dozens of these irritating warning chunks:
[[[ ../../include/osmocom/hnbap/CriticalityDiagnostics-IE-List.h:35:10: warning: ‘struct Member’ declared inside parameter list struct IE_Extensions *iE_Extensions /* OPTIONAL */; ^ /usr/local/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro ‘A_SET_OF’ void (*free)(type *); \ ^ ../../include/osmocom/hnbap/CriticalityDiagnostics-IE-List.h:31:2: note: in expansion of macro ‘A_SEQUENCE_OF’ A_SEQUENCE_OF(struct Member { ^ ../../include/osmocom/hnbap/CriticalityDiagnostics-IE-List.h:35:10: warning: its scope is only this definition or declaration, which is probably not what you want struct IE_Extensions *iE_Extensions /* OPTIONAL */; ^ /usr/local/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro ‘A_SET_OF’ void (*free)(type *); \ ^ ../../include/osmocom/hnbap/CriticalityDiagnostics-IE-List.h:31:2: note: in expansion of macro ‘A_SEQUENCE_OF’ A_SEQUENCE_OF(struct Member { ^ ]]]
The cause are numerous instances of code like:
[[[ /* CriticalityDiagnostics-IE-List */ typedef struct CriticalityDiagnostics_IE_List { A_SEQUENCE_OF(struct Member { Criticality_t iECriticality; ProtocolIE_ID_t iE_ID; TypeOfError_t typeOfError; struct IE_Extensions *iE_Extensions /* OPTIONAL */; /* * This type is extensible, * possible extensions are below. */
/* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list;
/* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CriticalityDiagnostics_IE_List_t; ]]]
"...which is probably not what you want". Turns out it kinda is what I want, I just don't want these warnings :P Filtering proper error messages from this mess is hard.
Any idea to get rid of these warnings would speed up my dev cycle dramatically...
Short of refactoring the way these A_SEQUENCE_OF() get generated. I guess the struct should rather be first declared with a unique name and then only the type name should be used in A_SEQUENCE_OF(). i.e. not like
osmo-iuh/include/osmocom/rua/RUA_CriticalityDiagnostics-IE-List.h: A_SEQUENCE_OF(struct Member {...
but like:
osmo-iuh/include/osmocom/rua/RUA_Disconnect.h: A_SEQUENCE_OF(RUA_IE_t) list;
Doesn't seem to come from the asn1tostruct.py...
Thanks!! ~Neels
Hi Neels,
the topic you're raising is one of asn1c's code generation, and it should probably be discussed in the mailing list / forum / ... of asn1c.
I did some research in the past and not find a way to disable those specific warnings in gcc (without recompiling gcc).
On Sat, Feb 20, 2016 at 07:27:08PM +0100, Harald Welte wrote:
Hi Neels,
the topic you're raising is one of asn1c's code generation, and it should probably be discussed in the mailing list / forum / ... of asn1c.
I did some research in the past and not find a way to disable those specific warnings in gcc (without recompiling gcc).
Ok, thanks! I'm glad I didn't investigate further than I did into gcc, then.
I'll see if/when I get time to talk to asn1c's list...
~Neels