# Is there a trick to remove/hide the legacy API notices?

**URL:** <https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850>\
**Category:** Programming\
**Created:** [July 27, 2018, 4:53pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850 "2018-07-27T16:53:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoschi](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/hoschi/32/899_2.png) [@hoschi](https://community.keyboard.io/u/hoschi)\
**Post date:** [July 27, 2018, 4:53pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/1 "2018-07-27T16:53:20Z")

</div>

I get A LOT of these messages after updating today:

```auto
------------------------------------------------------------------------                                                               
    [-Wdeprecated-declarations]                                                                                                        
   Kaleidoscope.useLoopHook(legacyLoopHook);                                                                                           
                                          ^                                                                                            
In file included from /home/hoschi/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Focus/src/Kaleidoscope/Focus.h:21,           
                 from /home/hoschi/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Focus/src/Kaleidoscope-Focus.h:21,           
                 from /home/hoschi/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Focus/src/Kaleidoscope/Focus.cpp:19:         
/home/hoschi/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/Kaleidoscope.h:184:15: note: declared here                     
   static void useLoopHook(loopHook hook)                                                                                              
               ^ ~~~~~~~~~~                                                                                                             
/home/hoschi/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Focus/src/Kaleidoscope/Focus.cpp:146:42: warning: 'static void kale
idoscope::Kaleidoscope_::useLoopHook(kaleidoscope::Kaleidoscope_::loopHook)' is deprecated:                                            
------------------------------------------------------------------------                                                               
The legacy plugin API based on hook registration is deprecated.                                                                        
                                                                                                                                       
Consider upgrading your plugins, or implementing the new interface                                                                     
described by `kaleidoscope::Plugin`. In particular, instead of using                                                                   
`Kaleidoscope.useLoopHook`, implement `.beforeEachCycle`,                                                                              
`.beforeReportingState()`, or `.afterEachCycle()` instead.                                                                             
                                                                                                                                       
If your plugins are up-to-date, and you are not a developer, it is                                                                     
usually safe to ignore this message. Especally if the full error
points to a line containing `legacyLoopHook` or `legacyEventHandler`.                                                               

```

Is this something I can influence?

Also I get this warning, is this important?

```auto
/usr/share/arduino/hardware/arduino/avr/cores/arduino/WString.cpp: In member function 'void String::remove(unsigned int, unsigned int)':
/usr/share/arduino/hardware/arduino/avr/cores/arduino/WString.cpp:699:9: warning: 'char* strncpy(char*, const char*, size_t)' accessing 0 or more bytes at offsets [0, 32767] and [0, 32767] may overlap up to 65535 bytes at offset [98301, 32767] [-Wrestrict]             
  strncpy(writeTo, buffer + index + count,len - index);

```

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 27, 2018, 6:17pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/2 "2018-07-27T18:17:32Z")

</div>

> [@hoschi](#):
>
> Is this something I can influence?

If you are building from the commandline, add the following line to a `.kaleidoscope-builder.conf` file (in the same dir as your `Makefile`):

```auto
LOCAL_CFLAGS="-DKALEIDOSCOPE_ENABLE_V1_PLUGIN_API=0"

```

If you are using the Arduino IDE, then edit `~/Arduino/hardware/keyboardio/avr/boards.txt`, find this line:

```auto
model01.build.extra_flags={build.usb_flags} '-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"'

```

and replace it with this:

```auto
model01.build.extra_flags={build.usb_flags} '-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' '-DKALEIDOSCOPE_ENABLE_V1_PLUGIN_API=0'

```

---

<div class="post-metadata">

**Author:** ![hoschi](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/hoschi/32/899_2.png) [@hoschi](https://community.keyboard.io/u/hoschi)\
**Post date:** [July 28, 2018, 3:28pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/3 "2018-07-28T15:28:09Z")

</div>

@algernon

> LOCAL\_CFLAGS=“-DKALEIDOSCOPE\_ENABLE\_V1\_PLUGIN\_API=0”

solved the problem of legacy plugin API warnings, thanks. The one in `WString.cpp` still persists, can you help me with that too?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 28, 2018, 6:41pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/4 "2018-07-28T18:41:13Z")

</div>

> [@hoschi](#):
>
> The one in `WString.cpp` still persists, can you help me with that too?

That’s in Arduino core, and looks not relevant (we don’t use `String`, I believe). I think it is safe to ignore for now. Unless you do use it in your sketch…

Out of curiosity, what version of Arduino are you using?

---

<div class="post-metadata">

**Author:** ![hoschi](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/hoschi/32/899_2.png) [@hoschi](https://community.keyboard.io/u/hoschi)\
**Post date:** [July 29, 2018, 1:28pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/5 "2018-07-29T13:28:44Z")

</div>

> [@algernon](#):
>
> That’s in Arduino core, and looks not relevant (we don’t use `String` , I believe). I think it is safe to ignore for now. Unless you do use it in your sketch…

Not that I know.

> [@algernon](#):
>
> Out of curiosity, what version of Arduino are you using?

How do I check that?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 29, 2018, 6:24pm UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/6 "2018-07-29T18:24:49Z")

</div>

> [@hoschi](#):
>
> How do I check that?

Start the Arduino IDE, and select `Help/About` from the menu. That should show the version somewhere (likely near the top).

---

<div class="post-metadata">

**Author:** ![hoschi](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/hoschi/32/899_2.png) [@hoschi](https://community.keyboard.io/u/hoschi)\
**Post date:** [August 11, 2018, 8:38am UTC](https://community.keyboard.io/t/is-there-a-trick-to-remove-hide-the-legacy-api-notices/1850/7 "2018-08-11T08:38:52Z")

</div>

Arduino IDE says 1.8.5
