Home/Support/Support Forum/Strange error: "Duplicate 'const' keywords not allowed in this context."
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Strange error: "Duplicate 'const' keywords not allowed in this context."

0 votes
Dynamic C has no problem with the following function prototype: void my_function(const int *a, const int b);

On the contrary, this (almost identical) one gives a compilation error: void my_function(const int a, const int *b);

Duplicate 'const' keywords not allowed in this context.

And this one too: void my_function(const int a, const int b);

Is it maybe a bug of the compiler?
asked Mar 17, 2014 in Rabbit by tito.brasolin New to the Community (4 points)

Please log in or register to answer this question.

2 Answers

0 votes
It's hard to tell what could be wrong without seeing the actual code. Details on the const keyword are in the DC user manual.

The best thing to do is to put together a short test program demonstrating the issue and send it in to tech.support@digi.com.
answered Mar 17, 2014 by trooper2 Veteran of the Digi Community (589 points)
Well, here is the shortest test program I can think of:

  void my_function(const int a, const int *b);
  main(){}

I'm going to send it to tech.support, thank you trooper2.
0 votes
This is a known and documented compiler issue: https://github.com/digidotcom/DCRabbit_10/commit/419aefed3217aaf3656cd823bc2b74875b7a2d88
answered Jan 20, 2016 by tito.brasolin New to the Community (4 points)
edited Jan 20, 2016 by tito.brasolin
...