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

**URL:** <https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678>\
**Category:** Rabbit\
**Tags:** const\
**Created:** [March 17, 2014, 4:43am UTC](https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678 "2014-03-17T04:43:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tito.brasolin](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tito.brasolin](https://forums.digi.com/u/tito.brasolin)\
**Post date:** [March 17, 2014, 4:43am UTC](https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678/1 "2014-03-17T04:43:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![trooper2](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@trooper2](https://forums.digi.com/u/trooper2)\
**Post date:** [March 17, 2014, 8:00am UTC](https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678/2 "2014-03-17T08:00:24Z")

</div>

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](mailto:tech.support@digi.com).

---

<div class="post-metadata">

**Author:** ![tito.brasolin](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tito.brasolin](https://forums.digi.com/u/tito.brasolin)\
**Post date:** [March 17, 2014, 8:40am UTC](https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678/3 "2014-03-17T08:40:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tito.brasolin](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tito.brasolin](https://forums.digi.com/u/tito.brasolin)\
**Post date:** [January 20, 2016, 2:49pm UTC](https://forums.digi.com/t/strange-error-duplicate-const-keywords-not-allowed-in-this-context/12678/4 "2016-01-20T14:49:15Z")

</div>

This is a known and documented compiler issue: [https://github.com/digidotcom/DCRabbit\_10/commit/419aefed3217aaf3656cd823bc2b74875b7a2d88](https://github.com/digidotcom/DCRabbit_10/commit/419aefed3217aaf3656cd823bc2b74875b7a2d88)
