-
Notifications
You must be signed in to change notification settings - Fork 38
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
Compilation issues in CCS C Compiler #39
Comments
It's not a typo, it's just an indication that literal is unsigned. But probably should be |
Yep, got it. Ok, I compared it to the code in the repo and the search showed a missing Notably, I am attempting an integration on a PIC18F57Q84 , and my compiler CCS C Info ( https://www.ccsinfo.com/ ) is throwing a fit about this line - it does not define
It's also throwing errors about const , so I'll be walking through why this is happening shortly. Insights to the use of const on an 8-bit system is also welcome. I would be happy to share the integration steps if they differ from your documentation. |
If your compiler doesn't define |
However, the compiler does support fixed width int types, and I am using exactly these elsewhere in the program. I am holding onto hope this does integrate ... first step was removing all const since this compiler will do this: |
Compiler MFG has communicated that they will consider adding |
I don't actually think that const's should not work, I think they will, try to leave them as is. As for Do you have any other issues with compilation? |
Yes, a few. Currently fighting what should be valid code. The compiler believes that the "defaultConfig" struct is somehow a problem. Compiling C:\Users\beadon\Documents\GitHub\embedded-cli-mods\main on 13-Nov-23 at 13:11 |
In the interest of getting this resolved, I have invited you to the demonstration integration with this chipset. You comments are welcome. |
Want to hack on this with me at the same time ? |
I don't have that compiler and from what I see, it has only paid version. You've included compiler errors, but I don't see any struct access at lines 736-738. Are you using modified version of header? Can you attach it here so I can look at it? |
I believe this free version (demo) should work . Unfortunately I believe it is windows only. ( https://www.ccsinfo.com/ccsfreedemo.php ) I needed to snag the embedded_cli.c and embedded_cli.h from this repository because the all-in-one combined header file was throwing too many problems (seemed compiler specific). I will see about adding the demo exe to the public demo repository ( https://github.com/beadon/ecli_demo ) |
Exe has been added to the public repo for testing. It has some reduced functionality, but I am expecting to see the same errors. The public repo has the latest as I try and integrate. errors revolve around typedefs: typedef struct EmbeddedCliImpl EmbeddedCliImpl; and the separate struct definitions later on in the code. If I choose to address these by defining the structs and typedef at the same time, then I am faced with a (different) problem: this overloaded function (very slick by the way!) -- void (*onCommand)(EmbeddedCli *cli, CliCommand *command); which does not appear to be supported ? How would I write it otherwise ? |
Have put this down for a day or so as I think about it, and work on other items in parallel. Any thoughts ? |
I didn't have time yet to look at this, hopefully I'll take a look on weekend. |
Ok, I am going to change the order of the typedefs , I've re-read and I believe if the compiler is strict we may need to define the struct first, then typedef .. as for the overloaded functions I am thinking the same thing. However, I will miss having the correct type checking. (but maybe that's only offered with C++?) |
I've managed to make it compile: I've attached modified Notice that this is single header version so you should remove Inside your repository I also added onCommand assignment (otherwise it won't compile saying no valid assignment to onCommand): // main.c
// ...
void onCommand(EmbeddedCli *embeddedCli, CliCommand *command)
{
// your implementation
}
void main()
{
// ...
cli->onCommand = onCommand;
} And defined // main.h
// ...
#define UINTPTR_MAX 0xFFFF
#include "embedded_cli.h"
// ... Try to use it and tell me if errors somewhere else. If it does, include full error logs and relevant source code where it errors. |
I tried to compile it again and noticed static char defaultInvitation[] = "> "; And then instead of defaultConfig.invitation = "> "; Use that array: defaultConfig.invitation = defaultInvitation; Other two warnings seem not important. |
Truly nice work ! Yes, I have implemented these as you describe, and updated the repo here ( https://github.com/beadon/ecli_demo I will be trying it on a serial line tomorrow. This is looking very promising ! |
Have not forgotten about this, have needed to lay in an RTOS first so I can use the right calls as I implement the cli. I will keep you posted :) |
Have gotten to the implementation, however, the processor is absolutely freaking out. I can't distinguish exactly what is a compiler issue, or what might be a hardware issue. At the moment, I am having an issue with the command binding because the compiler does not support compound literals. To get around things , I've chosen to go this route, but I think the compiler is silently creating broken code.
Any recommendations for doing the command binding without compound literals ? |
current code is here: https://github.com/beadon/ecli_demo/tree/pic24_support |
Sorry for the delay on reply. You can just assign fields of struct manually. CliCommandBinding tempBinding;
tempBinding.name = "hello";
// other assignments Will that help? |
There appears to be a typo in the released v0.1.3 .h file
See : https://github.com/funbiscuit/embedded-cli/releases/tag/v0.1.3
Line 49,
#elif UINTPTR_MAX == 0xFFFFFFFFFFFFFFFFu
should probably be:
#elif UINTPTR_MAX == 0xFFFFFFFFFFFFFFFF
right ?
The text was updated successfully, but these errors were encountered: