{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/2078","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/2078/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/2078/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/2078/events","html_url":"https://github.com/esp8266/Arduino/issues/2078","id":157834173,"number":2078,"title":"section type conflict with __c","user":{"login":"ewasscher","id":2017799,"avatar_url":"https://avatars.githubusercontent.com/u/2017799?v=3","gravatar_id":"","url":"https://api.github.com/users/ewasscher","html_url":"https://github.com/ewasscher","followers_url":"https://api.github.com/users/ewasscher/followers","following_url":"https://api.github.com/users/ewasscher/following{/other_user}","gists_url":"https://api.github.com/users/ewasscher/gists{/gist_id}","starred_url":"https://api.github.com/users/ewasscher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewasscher/subscriptions","organizations_url":"https://api.github.com/users/ewasscher/orgs","repos_url":"https://api.github.com/users/ewasscher/repos","events_url":"https://api.github.com/users/ewasscher/events{/privacy}","received_events_url":"https://api.github.com/users/ewasscher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/esp8266/Arduino/labels/component:%20core","name":"component: core","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-06-01T06:39:42Z","updated_at":"2016-06-01T08:01:54Z","closed_at":null,"body":"### Basic Infos\r\nWith (a modified version of) the arduino-dsmr library (https://github.com/matthijskooijman/arduino-dsmr) building the included examples for ESP8266 fails with \"section type conflict with __c\"\r\n\r\n#### Hardware\r\nHardware:\t\t\tAny ESP8266\r\nCore Version:      \t2.2.0\r\n\r\n### Description\r\n\r\nWith (a modified version of) the arduino-dsmr library (https://github.com/matthijskooijman/arduino-dsmr) building the included examples for ESP8266 fails with \"section type conflict with __c\" when using PROGMEM string literals (e.g. INVALID_UNIT) in one of the library's headers. Should this be considered a bug in the ESP core? I can work around this, but if there's a bug in the core involved I'd prefer not to do so and wait a bit more for the bugfix.\r\n\r\n### Settings in IDE\r\n\r\nNot appliccable\r\n\r\n\r\n### Sketch\r\n\r\nSee the \"parse\" example sketch in the attached library\r\n\r\n### Debug Messages\r\n\r\n```\r\nIn file included from /home/ewasscher/Arduino/libraries/arduino-dsmr/src/dsmr.h:35:0,\r\n                 from /home/ewasscher/Arduino/arduino-dsmr-read-test/arduino-dsmr-read-test.ino:22:\r\n/home/ewasscher/Arduino/libraries/arduino-dsmr/src/dsmr/parser.h:160:31: error: dsmr::INVALID_UNIT causes a section type conflict with __c\r\n static constexpr char PROGMEM INVALID_UNIT[] = \"Invalid unit\";\r\n                               ^\r\nIn file included from /home/ewasscher/.arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266/Arduino.h:244:0,\r\n                 from /tmp/build8e00daea58ed4d885aed86a35f556178.tmp/sketch/arduino-dsmr-read-test.ino.cpp:1:\r\n/home/ewasscher/.arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266/pgmspace.h:21:51: note: '__c' was declared here\r\n #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))\r\n                                                   ^\r\n/home/ewasscher/.arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266/WString.h:38:76: note: in definition of macro 'FPSTR'\r\n #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))\r\n                                                                            ^\r\n/home/ewasscher/.arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266/WString.h:39:34: note: in expansion of macro 'PSTR'\r\n #define F(string_literal) (FPSTR(PSTR(string_literal)))\r\n                                  ^\r\n/home/ewasscher/Arduino/arduino-dsmr-read-test/arduino-dsmr-read-test.ino:110:20: note: in expansion of macro 'F'\r\n       Serial.print(F(\": \"));\r\n```\r\n[arduino-dsmr-esp.zip](https://github.com/esp8266/Arduino/files/292763/arduino-dsmr-esp.zip)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/222920942","html_url":"https://github.com/esp8266/Arduino/issues/2078#issuecomment-222920942","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/2078","id":222920942,"user":{"login":"Makuna","id":7972357,"avatar_url":"https://avatars.githubusercontent.com/u/7972357?v=3","gravatar_id":"","url":"https://api.github.com/users/Makuna","html_url":"https://github.com/Makuna","followers_url":"https://api.github.com/users/Makuna/followers","following_url":"https://api.github.com/users/Makuna/following{/other_user}","gists_url":"https://api.github.com/users/Makuna/gists{/gist_id}","starred_url":"https://api.github.com/users/Makuna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makuna/subscriptions","organizations_url":"https://api.github.com/users/Makuna/orgs","repos_url":"https://api.github.com/users/Makuna/repos","events_url":"https://api.github.com/users/Makuna/events{/privacy}","received_events_url":"https://api.github.com/users/Makuna/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T08:01:54Z","updated_at":"2016-06-01T08:01:54Z","body":"@ewasscher the thread @matthijskooijman referenced sums up the issue.  \r\n\r\nDue to the use of the templates function for `apply()` in the struct, GCC will not support it and it creates this error.\r\n\r\nWork around is to move the definition to a global or out of a function that relies on the linker to place it.  This has another side effect in that if you had several uses in your code of the same string, before they would have each had a unique memory address, by making one global and using it, you save a little memory.\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"Makuna"}}