compilation

How to ignore uninitialized variable error in MSVC

我的梦境 提交于 2020-12-03 05:04:41
问题 I'm having problems with MSVS compiler, I have the following code: if (!list) { *type = raw_data[*i++]; ptr = (char*) &size; ptr[1] = raw_data[*i++]; ptr[0] = raw_data[*i++]; name = new char[size+1]; memcpy (name, raw_data+*i, size); name[size] = '\0'; *i += size; } And later: if (!list) { s->name = name; s->name_size = size; } The value of list doesn't change in this function, however I can't compile the code because of this error: Error 1 error C4703: potentially uninitialized local pointer

How to ignore uninitialized variable error in MSVC

被刻印的时光 ゝ 提交于 2020-12-03 05:04:40
问题 I'm having problems with MSVS compiler, I have the following code: if (!list) { *type = raw_data[*i++]; ptr = (char*) &size; ptr[1] = raw_data[*i++]; ptr[0] = raw_data[*i++]; name = new char[size+1]; memcpy (name, raw_data+*i, size); name[size] = '\0'; *i += size; } And later: if (!list) { s->name = name; s->name_size = size; } The value of list doesn't change in this function, however I can't compile the code because of this error: Error 1 error C4703: potentially uninitialized local pointer

How to ignore uninitialized variable error in MSVC

你说的曾经没有我的故事 提交于 2020-12-03 05:04:30
问题 I'm having problems with MSVS compiler, I have the following code: if (!list) { *type = raw_data[*i++]; ptr = (char*) &size; ptr[1] = raw_data[*i++]; ptr[0] = raw_data[*i++]; name = new char[size+1]; memcpy (name, raw_data+*i, size); name[size] = '\0'; *i += size; } And later: if (!list) { s->name = name; s->name_size = size; } The value of list doesn't change in this function, however I can't compile the code because of this error: Error 1 error C4703: potentially uninitialized local pointer

How to ignore uninitialized variable error in MSVC

戏子无情 提交于 2020-12-03 05:04:06
问题 I'm having problems with MSVS compiler, I have the following code: if (!list) { *type = raw_data[*i++]; ptr = (char*) &size; ptr[1] = raw_data[*i++]; ptr[0] = raw_data[*i++]; name = new char[size+1]; memcpy (name, raw_data+*i, size); name[size] = '\0'; *i += size; } And later: if (!list) { s->name = name; s->name_size = size; } The value of list doesn't change in this function, however I can't compile the code because of this error: Error 1 error C4703: potentially uninitialized local pointer

How to write a lisp parser in Haskell?

本小妞迷上赌 提交于 2020-12-01 11:32:28
问题 I'm trying to write a lisp interpreter in haskell, inspired by Norvig's in Python (http://norvig.com/lispy.html). I have a successful tokenizer which I can link to if need be. Here it outputs the correct code up to Norvig's Python tokenizer. program = "(begin (define r 10) (* pi (* r r)))" astTokenized = tokenize program astTokenized == ["(","begin","(","define","r","10",")","(","*","pi","(","*","r","r",")",")",")"] Here I define my abstract syntax tree data type, although I know that it

Can a C compiler generate an executable 64-bits where pointers are 32-bits?

谁说我不能喝 提交于 2020-12-01 09:02:18
问题 Most programs fits well on <4GB address space but needs to use new features just available on x64 architecture. Are there compilers/platforms where I can use x64 registers and specific instructions but preserving 32-bits pointers to save memory? Is it possible do that transparently on legacy code? What switch to do that? OR What changes on code is it necessary to get 64-bits features while keep 32-bits pointers? 回答1: A simple way to circumvent this is if you'd have only few types for your

Can a C compiler generate an executable 64-bits where pointers are 32-bits?

别说谁变了你拦得住时间么 提交于 2020-12-01 09:02:09
问题 Most programs fits well on <4GB address space but needs to use new features just available on x64 architecture. Are there compilers/platforms where I can use x64 registers and specific instructions but preserving 32-bits pointers to save memory? Is it possible do that transparently on legacy code? What switch to do that? OR What changes on code is it necessary to get 64-bits features while keep 32-bits pointers? 回答1: A simple way to circumvent this is if you'd have only few types for your