Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using void ** reference #77

Closed
igorluppi opened this issue Apr 20, 2021 · 2 comments · Fixed by #95
Closed

Using void ** reference #77

igorluppi opened this issue Apr 20, 2021 · 2 comments · Fixed by #95
Assignees
Labels
enhancement New feature or request

Comments

@igorluppi
Copy link

igorluppi commented Apr 20, 2021

Status = CFE_TBL_GetAddress((void **)&ConfigTable, SCH_LAB_Global.TblHandle);

According to this reference, we should use the CFE_TBL_GetAddress like:

void * ConfigTableTmp = ConfigTable;
Status = CFE_TBL_GetAddress(&ConfigTableTmp, SCH_LAB_Global.TblHandle); 
ConfigTable = ConfigTableTmp;

The C reference recommends this instead of (void **) casting.

@skliper skliper added the enhancement New feature or request label Apr 20, 2021
@igorluppi
Copy link
Author

igorluppi commented Apr 20, 2021

Moreover, I opened the issue here once it's a valid example, but I have seen this among many apps from cfs bundle.
Another example: TO_lab_app, that uses just a generic (void *) casting: status = CFE_TBL_GetAddress((void *)&TO_LAB_Subs, TO_SubTblHandle); .
DS_App also does that (void *) casting.

@jphickey
Copy link
Contributor

jphickey commented Oct 1, 2021

Note this causes an aliasing warning when using -Wstrict-aliasing=2 and newer GCC versions. Been making an effort to clean these up lately.

@jphickey jphickey self-assigned this Oct 1, 2021
astrogeco added a commit to astrogeco/sch_lab that referenced this issue Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants