embeded/Cortex-M4 Ti2018. 4. 20. 09:39

예전에도 찾았다가 해결은 못한거 같은데

일단 간단하게 결론만 말하자면


__inline 대신에

estern __inline으로 선언하면 해결된다.

(__inline에서 호출되는 변수/함수들에 static이 되어있으면

이걸 다 따라가서 static 없애는 것 보다는 옳은 방향으로 보임)



error:  #1059-D: an entity with internal linkage cannot be referenced within an inline function with external linkage


internal linkage

internal linkage를 가지는 이름은 외부 translation unit으로 공개되지 않는다. internal linkage를 가지는 이름은 다음과 같다.


namespace scope에 선언된 static specifier가 붙은 이름

namespace scope에 선언된 anonymous union의 데이터 멤버

namespace scope에 선언된 const 혹은 constexpr이 붙고 volatile은 아닌 변수

unnamed namespace에 선언된 모든 이름



external linkage

 위에서 설명한 internal linkage와 다르게 external linkage를 가지는 이름은 다른 translation unit과 공유된다. 다시 말해서 어떤 이름이 external linkage를 가진다면 그 이름은 서로 다른 translation unit에서 사용되더라도 같은 내용을 가져야 한다.


namespace scoep에 선언 된 이름 중 internal linkage가 아닌 이름.

block scope에 선언된 함수

block scope에 선언된 변수 중에서 extern으로 선언된 변수 

[링크 : https://blog.seulgi.kim/2017/08/cpp-linkage.html]


Internal Linkage: An identifier implementing internal linkage is not accessible outside the translation unit it is declared in. Any identifier within the unit can access an identifier having internal linkage. It is implemented by the keyword static. An internally linked identifier is stored in initialized or uninitialized segment of RAM.  


External Linkage: An identifier implementing external linkage is visible to every translation unit. Externally linked identifiers are shared between translation units and are considered to be located at the outermost level of the program. In practice, this means that you must define an identifier in a place which is visible to all, such that it has only one visible definition. It is the default linkage for globally scoped variables and functions. Thus, all instances of a particular identifier with external linkage refer to the same identifier in the program. The keyword extern implements external linkage.

When we use the keyword extern, we tell the linker to look for the definition elsewhere. Thus, the declaration of an externally linked identifier does not take up any space. Extern identifiers are generally stored in initialized/uninitialized or text segment of RAM. If uninitialized, the value of the identifier is set to 0 by the kernel.

[링크 : https://www.geeksforgeeks.org/internal-linkage-external-linkage-c/]


That looks perfectly fine under the C99 rules. Because stack.c is compiled with both an extern and inline declaration of the function, it will be defined with external linkage and can also be inlined within that file.


Other files will have only the declaration, and so will link to the version with external linkage.


Note that the function isn't allowed to define any modifiable objects with static storage duration, or reference any functions or global variables that aren't extern. 

[링크 : https://stackoverflow.com/.../how-to-define-a-function-to-be-inline-internal-and-external-copy-in-c99]


If you specify both inline and extern in the function definition, then the definition is used only for inlining. In no case is the function compiled on its own, not even if you refer to its address explicitly. Such an address becomes an external reference, as if you had only declared the function, and had not defined it.


This combination of inline and extern has almost the effect of a macro. The way to use it is to put a function definition in a header file with these keywords, and put another copy of the definition (lacking inline and extern) in a library file. The definition in the header file causes most calls to the function to be inlined. If any uses of the function remain, they refer to the single copy in the library. 

[링크 : https://gcc.gnu.org/onlinedocs/gcc/Inline.html]


C99 inline semantics are often misunderstood. The inline specifier serves two purposes:


First, as a compiler hint in case of static inline and extern inline declarations. Semantics remain unchanged if you remove the specifier.


Second, in case of raw inline (ie without static or extern) to provide an inline definition as an alternative to an external one, which has to be present in a different translation unit. Not providing the external one is undefined behaviour, which will normally manifest as linking failure.

[링크 : https://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file]


translation unit은 C++ compilation의 기본 단위입니다. <소스 파일 하나 + 직접/간접적으로 include된 헤더파일의 내용물(전처리기 조건에 따라 몇몇은 무시)>로 구성되어 있습니다.


translation unit 한개는 object file, library나 실행가능한 프로그램으로 컴파일 될 수 있습니다. 

[링크 : http://hashcode.co.kr/questions/1244/translation-unit에-대해서]


A translation unit is the basic unit of compilation in C++. It consists of the contents of a single source file, plus the contents of any header files directly or indirectly included by it, minus those lines that were ignored using conditional preprocessing statements.


A single translation unit can be compiled into an object file, library, or executable program.


The notion of a translation unit is most often mentioned in the contexts of the One Definition Rule, and templates. 

[링크 : https://stackoverflow.com/questions/1106149/what-is-a-translation-unit-in-c]


2016/04/12 - [embeded/Cortex-M4 Ti] - keil/c99 에서 __inline ...?


Posted by 구차니

skip-grant어쩌구 우회해서 접속하고 변경해도 안되길래

마구마구 검색을 해봤는데


mysql과 mariadb의 보안정책상 db에 root 계정 접속시에는

계정도 root로(그러니까 sudo 쓰던가) 접근해야 한다.

라는 결론


$ sudo mysql -uroot -p

[sudo] password for odroid:

Enter password:

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 34

Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04


Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> 


[링크 : https://stackoverflow.com/.../access-denied-for-user-rootlocalhost-using-password-yes-after-new-instal]



+

라즈베리 파이는 5.5.59 버전으로 root에 로그인시 root 권한이 필요없다.

5.5~8.0 사이에 변화가 있었던거 같은데 changelog에서 뒤지다가 포기..

$ mysql --version

mysql  Ver 14.14 Distrib 5.5.59, for debian-linux-gnu (armv7l) using readline 6.3 


$ mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 367

Server version: 5.5.59-0+deb8u1 (Raspbian)


Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql>


mysql은

5.5/5.6/5.7->8.0 으로 점프했고


mariadb는 

5.5->10.0 으로 점프했다.

Posted by 구차니
개소리 왈왈/독서2018. 4. 19. 17:31

표지가 핑크핑크해서 그런가

사람들이 책보는게 많이 쳐다보네.. -_-a


내용 자체는 무난하고 교훈적이다.

[링크 : https://www.kyobobook.co.kr/product/detailViewKor.laf?barcode=9791186921487]


+

??p

하버드 대학의 심리학 교수 탈 벤-샤하르는 이렇게 말했다. "배우기에 실패하지 않으려면 실패하는 법부터 배워야 한다."


89p

자신을 피해자로 간주하는 데는 일종의 안락한 환상이 작용한다. 피해자가 자기 탓이 아니니 죄의식도 없다. 자기는 어쩔 수 없었으니 책임도 느끼지 못할뿐더러 주위 사람들의 달콤한 동정도 얻는다.


99p

이것이 바로 '시한폭탄 효과'다. 상황을 방치해서 점점 악화시키다가 폭발을 알리는 신호음이 들리면 그제야 나타난 영웅은 보란 듯이 폭탄을 분해한다. 폭탄을 오랫동안 방치할수록 구출 작전은 더 짜릿하고 흥미로워진다. 결국, 이런 사람들은 자기가 지른 불을 끄는 소방관이 되는 셈이다.


110p

우리가 도달하려는 '리스크 제로'에는 사실 모욕적인 면이 있다. 이 말에는 인간이 유아적이며(위험을 가늠하지 못하는 철부지) 덜 성숙했다(위험을 깨닫지 못하니 자신으 의지와 상관없이 보호돼야 한다)는 의미가 내포돼 있다. 이것은 우려와 공포를 퍼트려 전 인류를 미숙아로 만들려는 시도이며 가정뿐 아니라 사회에도 손을 뻗어 서서히 마비시키려는 계획이다.


217p

울 수 있는 사람은 자신이 허약한 존재임을 꺠닫고, 고통이 자신을 관통하고 나서야 서서히 멀어진다는 사실을 알기에 고통이 그다지 아프지 않다.


'개소리 왈왈 > 독서' 카테고리의 다른 글

책 - 챗봇혁명  (0) 2018.04.23
책 - 아버지의 인생수첩  (0) 2018.04.22
책 - 꿈을 도둑맞은 사람들에게  (0) 2018.04.17
도서관 신청도서 도착!  (0) 2018.04.04
책 - 돌이킬 수 없는 결정 자살  (2) 2018.04.04
Posted by 구차니
embeded/odroid2018. 4. 19. 17:29

라즈베리 2B보단 확실히 빠른데..

그렇다고 해서 쾌적하게 할 정도는 아닌거 같기도 하고..

(웹서버가 멀티프로세서 되는게 아니니 한개 CPU만 미친듯이 찍고 있기도 하고..)


테스트가 좀 더 필요하긴 함.

(다른 서버의 내용을 뽑아와서 넣고 로딩을 비교해봐야 할 듯)

'embeded > odroid' 카테고리의 다른 글

odroid eMMC / SD 리더 호환성  (0) 2018.05.14
odroid u3 저전력은 안되나..  (0) 2018.04.22
odroid u3 소비전력 재측정  (0) 2018.04.17
odroid u3 boot.ini  (0) 2018.04.17
odroid u3 libreelec  (0) 2018.02.21
Posted by 구차니

인쇄하려니 서버와 연결되지 않습니다라고 배째서

ActiveX 두번 삭제하고 전체 설치하고 쑈하다 보니

어 되네?


아무튼 상담남겨놓았는데

아내님의 연속 통화 + 파파몬의 공격으로

5시 정각부터 전화했는데 내가 통화중이라 못했다고

상담원도 나도 빵 터져서

수고하..(푸핫)셨습니다로 전화종료 ㅋㅋㅋ



https 대신에 http로 하면 빨리 되었을꺼라고 이야기 해주는데

그러니까 결론은... 서버 문제였나 보군 -_-



근데...

http로 접속하면 https로 돌려서 강제 하는게 기본 매너 아니었나 -ㅁ-?


[링크 : https://hi.nhis.or.kr/main.do]

[링크 : http://dodomami.tistory.com/67]

Posted by 구차니
Linux/Ubuntu2018. 4. 19. 10:10

일단은 켜고 나서 apt로 검색해봐도 뜨는게 없는것 봐서는 자동으로 패키지 목록 갱신 안하는 듯?

$ ps -ef |grep apt

odroid    3346  2860  0 11:33 pts/1    00:00:00 grep --color=auto apt


$ ps -ef |grep dpkg

odroid    3348  2860  0 11:33 pts/1    00:00:00 grep --color=auto dpkg 



$ cat /etc/apt/apt.conf.d/10periodic

APT::Periodic::Update-Package-Lists "0";

APT::Periodic::Download-Upgradeable-Packages "0";

APT::Periodic::AutocleanInterval "0"; 

[링크 : https://www.garron.me/en/linux/turn-off-stop-ubuntu-automatic-update.html]

'Linux > Ubuntu' 카테고리의 다른 글

apt-mark 사용자가 수동으로 설치한 패키지 목록  (0) 2018.05.08
powertop  (0) 2018.05.04
시스템 모니터링 툴(CUI)  (0) 2018.02.21
리눅스 팩스 서버 구축?  (0) 2018.02.09
cgroups  (0) 2017.08.24
Posted by 구차니

솔찍히 첫 문단부터 뜨끔(?) 하기도 했는데

근데.. 정말 한국에서 페미니즘이 이론적 근간이 존재는 하는가?

그리고 그걸 지지하기 위한 행동이 축적되어 있는가? 라는 물음에

어떤 대답을 하고

그걸 들어주는 사람들의 공감을 얻어낼 수 있을까?


해외와 다른 개념과 방향성의 페미니즘이라면

동음이의어로 인정을 해야 할까

아니면 새로운 단어로 정의를 해야 할까?


‘근본 없는 페미니즘’ ‘평등하다는 헛소리에 대한 반격’ ‘부드럽게 여성을 죽이는 법’….

[링크 : http://v.media.daum.net/v/20180419030134036]




+

아마도 페미니즘 외치는 사람들에게 진정한(?) 페미니즘을 위해서는

남자가 하나도 없는 국가를 세우고

거기서 일어나는 모든 일들에 대한 책임과 의무를 해결해 나가도록 하고

남자가 존재하는 세상에서도 그와 동일하게 행동하게 하면 되지 않을까 생각이 된다.


남자가 존재하지 않는 국가

물론 출산으로 인한 인구 감소를 제외하고

국방이나, 치안, 토목, 무역 등등 이 모든걸 해결하면 된다.


누군가는 싫어도 군대를 가야 하고

군대를 가서도 어떠한 보상 하나 없이 청춘을 버려야 하고

군대에서 죽더라도 다치더라도 묻혀야 하고

타국에 의해서 침공을 막아내면서 목숨을 버려야 하고

막지 못하면 노예로 팔려가고 유린당해야 하고


하수도나 전기를 다루다가 죽어야 하고

하지 않으면 전염병으로 많은 사람들이 고통을 받아야 하고


먹어야 하니 농사도 지어야 하고 고기도 잡고 돼지도 키워야 하고

페미니스트 들만 있다고 해도 법적 분쟁이나 무력상황이 존재안할리 없으니

누군가는 경찰을 하고 폭력을 일으키는 사람을 제압을 해야 한다.


불이 나면 또 다른 페미니스트를 구하기 위해 불로 뛰어들어야 하고

자기의 목숨을 담보로 어떠한 보상도 기대하지 않고 의무감으로 책임감으로 스스로 사지로 들어가야 한다.

여자라고 갑질이 없을리 없으니 직장에서 갑질을 당하며

스스로 일을 하면서 돈을 벌고, 집을 사고, 빚을 갚아나가며 기약없는 삶을 살아야 한다.


그 중에 누군가는 다른 여자들의 등을 쳐먹으면서 보이쉬함으로 승부할 수도 있고

더 여성성을 드러냄으로서 시기와 선망을 한몸에 받으면서 더 많은 급여를 받고 풍족하게 살 수도 있다.




근데 이 모든걸 여자만 있는 세상에서 해야만 한다고 하면

남자가 하나도 없으니 누군가는 하겠지만

(근데 정말 할까? 그럼 좀더 힘 없는 여자들이 강제로 해야만 하게 되는게 아닐까?),

그런 나라에서 다시 돌아와서 자신이 하지 않아도 될 상황이 된다면 그걸 다시 할까?


그렇다면 환경에 따라 자기보다 낮은 곳에 남자를 두어야 하는 그들의 사상은

정말 낮은 여성인권을 끌어올리기 위한 운동으로서 "페미니즘"이라고 할 수 있는 걸까?

Posted by 구차니

XBOX 패드로 하니까 확실히 편하다고 해야하나

자동 조준을 많이 쓰게 되니 조금 수월해진 기분

(물론 난이도 가장 쉬운걸로 하는 중이기도 하지만)


닷지를 쓰면서도 겁나 얻어 터지네 ㅠㅠ

아무튼 쪽수는 무서움 ㅠㅠ


저 해파리 같은놈 그냥 자동 조준으로 가볍게~ ㅋㅋ


쓸데없이 고퀄 돼지코 ㄷㄷ


아까 엄청 고생했던 녀석

투명할때는 무적판정인데 폭탄 들때 사격해서 터트려야 무력화 된다.


여기 까지 오니 예전에 하다가 스샷도 날려먹고(하드 고장나서)

했던 기억이 조금 나는 듯?

Posted by 구차니
embeded/raspberry pi2018. 4. 18. 17:45

생각해보니 예전에 i.MX283 에

dd로 생성한 img 굽다가 실패한 이유가..

단순 dd로 만들고 나서 

mkfs로 포맷만 했기 때문이려나?


아래 스크립트에서는

dd로 생성 후

fdisk로 파티션을 만들고

mkfs.vfat과 mkfs.ext4로 포맷을 해주도록 되어있다.


[링크 : https://github.com/andrius/build-raspbian-image/blob/master/raspbian/build_raspbian_sd_card.sh]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=41520]

Posted by 구차니
embeded/odroid2018. 4. 17. 22:49

어라.. 왜케 달라지고 희한하게 나오지?


 idle + lan + hdmi

 2.50

 idle + lan

 2.45

 idle + hdmi

 2.23

 idle

 2.22


'embeded > odroid' 카테고리의 다른 글

odroid u3 저전력은 안되나..  (0) 2018.04.22
odroid u3 mediawiki 설치해보니..  (0) 2018.04.19
odroid u3 boot.ini  (0) 2018.04.17
odroid u3 libreelec  (0) 2018.02.21
odroid 해상도 설정  (0) 2018.02.21
Posted by 구차니