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

API prototype changes to address compiler warnings #36

Closed
skliper opened this issue Sep 30, 2019 · 12 comments
Closed

API prototype changes to address compiler warnings #36

skliper opened this issue Sep 30, 2019 · 12 comments
Labels
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Sep 30, 2019

These areas of the OSAL API need clean up.

Task API:

  • OS_TaskCreate() stack pointer is declared const (read-only). By definition, stack space should not be read-only.
  • OS_TaskInstallDeleteHandler() takes a "void *" argument rather than a function pointer. This should be a function pointer.

Module API:

  • To be consistent with the other API's, a separate property structure should be defined for use with OS_ModuleInfo(). Currently this returns the internal OSAL "OS_module_record_t", while all other API's return a dedicated property object. This is necessary to allow the internal implementation of the OSAL to change in the future while preserving the public API types.
  • The types should be changed to use the "cpuaddr" type rather than uint32 where a memory address is stored (OS_module_address_t, OS_SymbolLookup())

General:

  • When passing character strings as input to functions these should preferably be declared as "const char *" whenever possible. This allows one to pass string literals into the function. Otherwise a warning may be generated if a literal is used for a parameter declared as "char *".
@skliper skliper added this to the osal-4.2 milestone Sep 30, 2019
@skliper skliper self-assigned this Sep 30, 2019
@skliper skliper added the bug label Sep 30, 2019
@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Imported from trac issue 13. Created by jphickey on 2015-01-13T14:16:09, last modified: 2015-11-20T16:22:16

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2015-03-18 23:16:27:

Pushed branch "trac-13-compiler_warning_fixes", commit [changeset:a7b7869]

This fixes a number of warnings in the OSAL build and improves the consistency and const-correctness of the API calls.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2015-03-19 11:11:53:

After some additional thought and review time I have decided that the list of fixes in the description of this ticket should really be individual change sets/commits so they can be independently reviewed.

This ticket will contain only fixes to adjust the const-correctness of the API calls. A different commit will be forthcoming that has only those changes.

The changes to the module API will be done in trac ticket #54, as the nature of this change is somewhat different and worthy of a separate review.

Greg has written ticket #47 and this can be used to track the fix for the places that a void * pointer is used instead of a function pointer (TaskCreate/Delete etc)

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2015-04-14 12:55:17:

This changeset has been rebased to the (unapproved) 2015-04-14 baseline

This is due to a dependency on files added/changed as part of trac #40. Attempting to base this change on the official 2015-02-26 OSAL is potentially possible but will result in merge conflicts when putting these back together again.

The new commit is [changeset:99df9e5]

This changeset addresses the type-correctness of various API calls, mainly making things "const" where they need to be and using the {{{cpuaddr}}} type rather than {{{uint32}}} where memory addresses are involved.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by sstrege on 2015-05-18 19:37:22:

Where/How is the new "cpuaddr" type defined?

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by sduran on 2015-06-01 11:46:41:

Recommend accept.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2015-06-02 13:53:56:

Updated commit (rebased): [changeset:a698faf]

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by jphickey on 2015-08-17 12:14:06:

== REBASE ==

This has been rebased to the current development branch for review at the next CCB.

Updated commit: [changeset:757e00e]

It has also been merged into the ic-ccb-review branch accordingly.

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by sstrege on 2015-08-21 18:28:45:

Approve/Accept

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by glimes on 2015-08-25 11:28:00:

Accept

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by acudmore on 2015-08-25 12:36:29:

Accept

@skliper
Copy link
Contributor Author

skliper commented Sep 30, 2019

Trac comment by glimes on 2015-09-08 13:51:20:

CCB meeting 2015-08-25 authorized this fix
to be merged into development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant