Author Topic: Irregular comportement for the F11 shortcut  (Read 6950 times)

Offline Loumnam

  • Single posting newcomer
  • *
  • Posts: 3
Irregular comportement for the F11 shortcut
« on: March 26, 2010, 12:54:34 pm »
Hi,

The F11 shortcut let you switch from a *.c/*.cpp to a *.h.
But if the corresponding *.c/*.cpp/*.h doesn't exists, it proposes to create it.

The problem is:

I am in a C project.
I create a *.h file, e.g. array.h.
I then press F11.
array.c/cpp doesn't exists, so it propose me to create it.
But it creates array.CPP, while I am in a C project!
And it is not just the extension: the file is considered in all aspects as a c++ file (in the *.cbp, CompilerVar= CPP and not CC, etc..)

Thanks for correcting this bug!

P.S: In case this is the desired comportement, a toolbox with the option to choose between C/C++ would be appreciated.

Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Irregular comportement for the F11 shortcut
« Reply #1 on: March 26, 2010, 01:00:14 pm »
And another one... please follow the forum rules and state a version of CB, OS, compiler  :? :lol:

BTW, If you're using 8.02 you can try a nigthly.... there were some problems in C handling in the past
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Loumnam

  • Single posting newcomer
  • *
  • Posts: 3
Re: Irregular comportement for the F11 shortcut
« Reply #2 on: March 26, 2010, 01:20:39 pm »
Oops, sorry!

Codeblocks SVN 6181
OS: Kubuntu 9.10 32bits
Compiler: gcc (Ubuntu 4.4.1-4ubuntu8) 4.4.1

Offline Loumnam

  • Single posting newcomer
  • *
  • Posts: 3
Re: Irregular comportement for the F11 shortcut
« Reply #3 on: April 11, 2010, 09:26:14 am »
Anyone?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Irregular comportement for the F11 shortcut
« Reply #4 on: April 11, 2010, 12:32:07 pm »
I suppose this is just a bug, c::b is used mostly as c++ ide...

You can submit a bug report at the berlios.de page and wait to be fixed...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Irregular comportement for the F11 shortcut
« Reply #5 on: April 11, 2010, 08:07:50 pm »
But it creates array.CPP, while I am in a C project!
There is no such thing like a C project. All projects are C/C++. However, to create the right file for you (with an extension .c) why don't you simply name the full file name, including the extension as you need, like "blah.c"?!

*.h files are also valid for C++, so the IDE cannot know what exactly you want to do (unless you tell by the file extension yourself).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Irregular comportement for the F11 shortcut
« Reply #6 on: April 11, 2010, 08:11:28 pm »
There is no such thing like a C project. All projects are C/C++. However, to create the right file for you (with an extension .c) why don't you simply name the full file name, including the extension as you need, like "blah.c"?!

*.h files are also valid for C++, so the IDE cannot know what exactly you want to do (unless you tell by the file extension yourself).
Yes but hitting f11 in a header (blah.h) doesn't ask you if you want to create .cpp or .c, it always creates blah.cpp file.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Irregular comportement for the F11 shortcut
« Reply #7 on: April 11, 2010, 08:16:00 pm »
Yes but hitting f11 in a header (blah.h) doesn't ask you if you want to create .cpp or .c, it always creates blah.cpp file.
Not for me :-)

But I recall that I did some modifications in that part of C::B literally ages ago... probably I did that already and forgot to submit... I need to check...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ