Author Topic: Compiler plugin API inconsistencies?  (Read 14975 times)

zieQ

  • Guest
Compiler plugin API inconsistencies?
« on: July 30, 2005, 03:11:19 pm »
Well I'm looking at the compiler plugin API and the gcc compiler plugin and I see inconsistencies.

First, there are Clean, Compile and Rebuild functions with an optional target parameter of type ProjectBuildTarget*
And there are the conterparts CompileAll, RebuildAll.

Then, my opinions:
- CleanAll is missing
- It seems that if we provide the default 0 value to the target parameter, the gcc compiler plugin would segfault.
- It seems to me that XXAll are redundant with the target=0 parameters of XX method or the documentation is not clear about that.

What about removing either the =0 after the target or provide no XXAll methods ?

zieQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compiler plugin API inconsistencies?
« Reply #1 on: July 30, 2005, 04:22:29 pm »
Well I'm looking at the compiler plugin API and the gcc compiler plugin and I see inconsistencies.

First, there are Clean, Compile and Rebuild functions with an optional target parameter of type ProjectBuildTarget*
And there are the conterparts CompileAll, RebuildAll.

Then, my opinions:
- CleanAll is missing
- It seems that if we provide the default 0 value to the target parameter, the gcc compiler plugin would segfault.
- It seems to me that XXAll are redundant with the target=0 parameters of XX method or the documentation is not clear about that.

What about removing either the =0 after the target or provide no XXAll methods ?

zieQ
The interface will not change any more, at least until 1.0 is out.
You 're right, some of those calls might be redundant but it's no harm and definetely not a reason to change the interface again.

About the crash you mentioned, can you send me the .RPT file located in the same dir with codeblocks.exe?

Yiannis.
Be patient!
This bug will be fixed soon...

zieQ

  • Guest
Re: Compiler plugin API inconsistencies?
« Reply #2 on: July 31, 2005, 09:30:03 am »
I said it MAY crash. Hopefully the function are never called with a value 0 as parameter! What about CleanAll missing. I know it could be done with Clean(0) but it would be more consistent with other XXXAll functions! More, there's no cleanAll option in the compile menu

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compiler plugin API inconsistencies?
« Reply #3 on: July 31, 2005, 09:47:57 am »
I said it MAY crash. Hopefully the function are never called with a value 0 as parameter!

It will not crash with a NULL parameter...
Let me clear this up a bit:

The xxxAll() compiler functions act on all the open projects, not all the targets of the active project.
So, Compile(target) would compile the active project's target or, if target==NULL, it would compile the whole project.
CompileAll() would compile all the open projects.

Yiannis.
Be patient!
This bug will be fixed soon...

zieQ

  • Guest
Re: Compiler plugin API inconsistencies?
« Reply #4 on: July 31, 2005, 10:21:49 am »
Ok, it appears that I had not understood completly the API, it's ok now.
Some comments should be added to make it clearer. I could add them since I'm already adding target dependencies!?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compiler plugin API inconsistencies?
« Reply #5 on: July 31, 2005, 10:50:54 am »
Ok, it appears that I had not understood completly the API, it's ok now.
Some comments should be added to make it clearer. I could add them since I'm already adding target dependencies!?

Yes, some parts of the SDK are not documented yet  :oops:
If you think you can add comments, feel free to.

Yiannis.
Be patient!
This bug will be fixed soon...

zieQ

  • Guest
Re: Compiler plugin API inconsistencies?
« Reply #6 on: July 31, 2005, 11:27:27 am »
OK, I'll do.

Still missing a CleanAll IMHO  :) Maybe i could implement it ;)