> warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

本文探讨了在C++中使用构造函数传递字符串时遇到的警告:'deprecated conversion from string constant to ‘char*’'。文章通过示例代码解释了问题的根源在于字符串常量与非const char*指针之间的不匹配,并提供了简单有效的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

在给构造函数传递字符串的时候经常出现这个问题,这个问题在我接触C++以来一直没头绪解决,今天刚好碰到了一篇文章的解释之后醐醍灌顶,虽然也不是什么大错误,不过还是想记录一下以便日后朋友们和自己能够看到解决问题
先看一下简单的代码吧:

图片在这里插入图片描述
当创建A类对象时,传递字符串给构造函数进行初始化,由于字符串是常量,用char *name指针来接收时,编译器会认为你想要有通过指针来修改字符串的内容,此时就会警告。
解决:
只要在char *name前面加上const限定所传的参数是不可以修改的内容时就不会警告,其实倒也不是特别大的问题,因为直接传递字符串本来就是常量了,一般我们也不会去改变内容,哈哈哈,就先到这里吧

tianhangsong@ubuntu:~/NachOS-4.1/code/build.linux$ make depend g++ -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -M ../lib/bitmap.cc ../lib/debug.cc ../lib/hash.cc ../lib/libtest.cc ../lib/list.cc ../lib/sysdep.cc ../machine/interrupt.cc ../machine/stats.cc ../machine/timer.cc ../machine/console.cc ../machine/machine.cc ../machine/mipssim.cc ../machine/translate.cc ../machine/network.cc ../machine/disk.cc ../threads/alarm.cc ../threads/kernel.cc ../threads/main.cc ../threads/scheduler.cc ../threads/synch.cc ../threads/synchlist.cc ../threads/thread.cc ../userprog/addrspace.cc ../userprog/exception.cc ../userprog/synchconsole.cc ../filesys/directory.cc ../filesys/filehdr.cc ../filesys/filesys.cc ../filesys/pbitmap.cc ../filesys/openfile.cc ../filesys/synchdisk.cc ../network/post.cc > makedep ed - Makefile.dep < eddep rm eddep makedep tianhangsong@ubuntu:~/NachOS-4.1/code/build.linux$ make g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../lib/bitmap.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../lib/debug.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../lib/libtest.cc ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] "7", "8", "9", "10", "11", "12", "13", "14"}; ^ ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../lib/libtest.cc:59:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../lib/sysdep.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/interrupt.cc ../machine/interrupt.cc:29:45: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] static char *intLevelNames[] = { "off", "on"}; ^ ../machine/interrupt.cc:29:45: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] "network recv"}; ^ ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/interrupt.cc:32:18: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/stats.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/timer.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/console.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/machine.cc ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] "illegal instruction" }; ^ ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/machine.cc:19:27: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/mipssim.cc In file included from ../machine/mipssim.cc:22:0: ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] }; ^ ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.h:227:7: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ../machine/mipssim.cc: In member function ‘void Machine::OneInstruction(Instruction*)’: ../machine/mipssim.cc:139:56: warning: array subscript has type ‘char’ [-Wchar-subscripts] struct OpString *str = &opStrings[instr->opCode]; ^ ../machine/mipssim.cc:158:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] sum = registers[instr->rs] + registers[instr->rt]; ^ ../machine/mipssim.cc:158:50: warning: array subscript has type ‘char’ [-Wchar-subscripts] sum = registers[instr->rs] + registers[instr->rt]; ^ ../machine/mipssim.cc:159:28: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (!((registers[instr->rs] ^ registers[instr->rt]) & SIGN_BIT) && ^ ../machine/mipssim.cc:159:51: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (!((registers[instr->rs] ^ registers[instr->rt]) & SIGN_BIT) && ^ ../machine/mipssim.cc:160:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] ((registers[instr->rs] ^ sum) & SIGN_BIT)) { ^ ../machine/mipssim.cc:164:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = sum; ^ ../machine/mipssim.cc:168:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] sum = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:169:28: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (!((registers[instr->rs] ^ instr->extra) & SIGN_BIT) && ^ ../machine/mipssim.cc:174:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = sum; ^ ../machine/mipssim.cc:178:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:178:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:182:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] + registers[instr->rt]; ^ ../machine/mipssim.cc:182:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] + registers[instr->rt]; ^ ../machine/mipssim.cc:182:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] + registers[instr->rt]; ^ ../machine/mipssim.cc:186:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] & registers[instr->rt]; ^ ../machine/mipssim.cc:186:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] & registers[instr->rt]; ^ ../machine/mipssim.cc:186:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] & registers[instr->rt]; ^ ../machine/mipssim.cc:190:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] & (instr->extra & 0xffff); ^ ../machine/mipssim.cc:190:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] & (instr->extra & 0xffff); ^ ../machine/mipssim.cc:194:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] == registers[instr->rt]) ^ ../machine/mipssim.cc:194:49: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] == registers[instr->rt]) ^ ../machine/mipssim.cc:201:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (!(registers[instr->rs] & SIGN_BIT)) ^ ../machine/mipssim.cc:206:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] > 0) ^ ../machine/mipssim.cc:211:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] <= 0) ^ ../machine/mipssim.cc:218:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] & SIGN_BIT) ^ ../machine/mipssim.cc:223:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] != registers[instr->rt]) ^ ../machine/mipssim.cc:223:49: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] != registers[instr->rt]) ^ ../machine/mipssim.cc:228:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rt] == 0) { ^ ../machine/mipssim.cc:232:45: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[LoReg] = registers[instr->rs] / registers[instr->rt]; ^ ../machine/mipssim.cc:232:68: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[LoReg] = registers[instr->rs] / registers[instr->rt]; ^ ../machine/mipssim.cc:233:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[HiReg] = registers[instr->rs] % registers[instr->rt]; ^ ../machine/mipssim.cc:233:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[HiReg] = registers[instr->rs] % registers[instr->rt]; ^ ../machine/mipssim.cc:238:43: warning: array subscript has type ‘char’ [-Wchar-subscripts] rs = (unsigned int) registers[instr->rs]; ^ ../machine/mipssim.cc:239:43: warning: array subscript has type ‘char’ [-Wchar-subscripts] rt = (unsigned int) registers[instr->rt]; ^ ../machine/mipssim.cc:258:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[NextPCReg] + 4; ^ ../machine/mipssim.cc:260:31: warning: array subscript has type ‘char’ [-Wchar-subscripts] pcAfter = registers[instr->rs]; ^ ../machine/mipssim.cc:265:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:279:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:297:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = instr->extra << 16; ^ ../machine/mipssim.cc:301:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:313:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:341:41: warning: array subscript has type ‘char’ [-Wchar-subscripts] nextLoadValue = registers[instr->rt]; ^ ../machine/mipssim.cc:365:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:393:41: warning: array subscript has type ‘char’ [-Wchar-subscripts] nextLoadValue = registers[instr->rt]; ^ ../machine/mipssim.cc:421:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[HiReg]; ^ ../machine/mipssim.cc:425:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[LoReg]; ^ ../machine/mipssim.cc:429:40: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[HiReg] = registers[instr->rs]; ^ ../machine/mipssim.cc:433:40: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[LoReg] = registers[instr->rs]; ^ ../machine/mipssim.cc:437:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] Mult(registers[instr->rs], registers[instr->rt], TRUE, ^ ../machine/mipssim.cc:437:48: warning: array subscript has type ‘char’ [-Wchar-subscripts] Mult(registers[instr->rs], registers[instr->rt], TRUE, ^ ../machine/mipssim.cc:442:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] Mult(registers[instr->rs], registers[instr->rt], FALSE, ^ ../machine/mipssim.cc:442:48: warning: array subscript has type ‘char’ [-Wchar-subscripts] Mult(registers[instr->rs], registers[instr->rt], FALSE, ^ ../machine/mipssim.cc:447:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = ~(registers[instr->rs] | registers[instr->rt]); ^ ../machine/mipssim.cc:447:46: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = ~(registers[instr->rs] | registers[instr->rt]); ^ ../machine/mipssim.cc:447:69: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = ~(registers[instr->rs] | registers[instr->rt]); ^ ../machine/mipssim.cc:451:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] | registers[instr->rt]; ^ ../machine/mipssim.cc:451:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] | registers[instr->rt]; ^ ../machine/mipssim.cc:451:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] | registers[instr->rt]; ^ ../machine/mipssim.cc:455:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] | (instr->extra & 0xffff); ^ ../machine/mipssim.cc:455:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] | (instr->extra & 0xffff); ^ ../machine/mipssim.cc:460:23: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 1, registers[instr->rt])) ^ ../machine/mipssim.cc:460:64: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 1, registers[instr->rt])) ^ ../machine/mipssim.cc:466:23: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 2, registers[instr->rt])) ^ ../machine/mipssim.cc:466:64: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 2, registers[instr->rt])) ^ ../machine/mipssim.cc:471:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] << instr->extra; ^ ../machine/mipssim.cc:471:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] << instr->extra; ^ ../machine/mipssim.cc:475:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] << ^ ../machine/mipssim.cc:475:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] << ^ ../machine/mipssim.cc:476:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] & 0x1f); ^ ../machine/mipssim.cc:480:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] < registers[instr->rt]) ^ ../machine/mipssim.cc:480:48: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] < registers[instr->rt]) ^ ../machine/mipssim.cc:481:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = 1; ^ ../machine/mipssim.cc:483:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = 0; ^ ../machine/mipssim.cc:487:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (registers[instr->rs] < instr->extra) ^ ../machine/mipssim.cc:488:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = 1; ^ ../machine/mipssim.cc:490:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = 0; ^ ../machine/mipssim.cc:494:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] rs = registers[instr->rs]; ^ ../machine/mipssim.cc:497:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = 1; ^ ../machine/mipssim.cc:499:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = 0; ^ ../machine/mipssim.cc:503:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] rs = registers[instr->rs]; ^ ../machine/mipssim.cc:504:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] rt = registers[instr->rt]; ^ ../machine/mipssim.cc:506:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = 1; ^ ../machine/mipssim.cc:508:25: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = 0; ^ ../machine/mipssim.cc:512:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] >> instr->extra; ^ ../machine/mipssim.cc:512:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] >> instr->extra; ^ ../machine/mipssim.cc:516:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] >> ^ ../machine/mipssim.cc:516:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rt] >> ^ ../machine/mipssim.cc:517:26: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] & 0x1f); ^ ../machine/mipssim.cc:521:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rt]; ^ ../machine/mipssim.cc:523:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = tmp; ^ ../machine/mipssim.cc:527:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rt]; ^ ../machine/mipssim.cc:528:30: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp >>= (registers[instr->rs] & 0x1f); ^ ../machine/mipssim.cc:529:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = tmp; ^ ../machine/mipssim.cc:533:28: warning: array subscript has type ‘char’ [-Wchar-subscripts] diff = registers[instr->rs] - registers[instr->rt]; ^ ../machine/mipssim.cc:533:51: warning: array subscript has type ‘char’ [-Wchar-subscripts] diff = registers[instr->rs] - registers[instr->rt]; ^ ../machine/mipssim.cc:534:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (((registers[instr->rs] ^ registers[instr->rt]) & SIGN_BIT) && ^ ../machine/mipssim.cc:534:50: warning: array subscript has type ‘char’ [-Wchar-subscripts] if (((registers[instr->rs] ^ registers[instr->rt]) & SIGN_BIT) && ^ ../machine/mipssim.cc:535:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] ((registers[instr->rs] ^ diff) & SIGN_BIT)) { ^ ../machine/mipssim.cc:539:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = diff; ^ ../machine/mipssim.cc:543:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] - registers[instr->rt]; ^ ../machine/mipssim.cc:543:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] - registers[instr->rt]; ^ ../machine/mipssim.cc:543:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] - registers[instr->rt]; ^ ../machine/mipssim.cc:548:23: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 4, registers[instr->rt])) ^ ../machine/mipssim.cc:548:64: warning: array subscript has type ‘char’ [-Wchar-subscripts] (registers[instr->rs] + instr->extra), 4, registers[instr->rt])) ^ ../machine/mipssim.cc:553:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:585:33: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = registers[instr->rt]; ^ ../machine/mipssim.cc:588:58: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xff000000) | ((registers[instr->rt] >> 8) & ^ ../machine/mipssim.cc:592:58: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xffff0000) | ((registers[instr->rt] >> 16) & ^ ../machine/mipssim.cc:596:58: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xffffff00) | ((registers[instr->rt] >> 24) & ^ ../machine/mipssim.cc:612:27: warning: array subscript has type ‘char’ [-Wchar-subscripts] tmp = registers[instr->rs] + instr->extra; ^ ../machine/mipssim.cc:644:55: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xffffff) | (registers[instr->rt] << 24); ^ ../machine/mipssim.cc:647:53: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xffff) | (registers[instr->rt] << 16); ^ ../machine/mipssim.cc:650:51: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = (value & 0xff) | (registers[instr->rt] << 8); ^ ../machine/mipssim.cc:653:33: warning: array subscript has type ‘char’ [-Wchar-subscripts] value = registers[instr->rt]; ^ ../machine/mipssim.cc:675:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] ^ registers[instr->rt]; ^ ../machine/mipssim.cc:675:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] ^ registers[instr->rt]; ^ ../machine/mipssim.cc:675:67: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rd] = registers[instr->rs] ^ registers[instr->rt]; ^ ../machine/mipssim.cc:679:21: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] ^ (instr->extra & 0xffff); ^ ../machine/mipssim.cc:679:44: warning: array subscript has type ‘char’ [-Wchar-subscripts] registers[instr->rt] = registers[instr->rs] ^ (instr->extra & 0xffff); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/translate.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/network.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../machine/disk.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/alarm.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/kernel.cc ../threads/kernel.cc: In member function ‘void Kernel::Initialize()’: ../threads/kernel.cc:93:38: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] currentThread = new Thread("main"); ^ ../threads/kernel.cc: In member function ‘void Kernel::ThreadSelfTest()’: ../threads/kernel.cc:152:39: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] semaphore = new Semaphore("test", 0); ^ ../threads/kernel.cc: In member function ‘void Kernel::NetworkTest()’: ../threads/kernel.cc:208:22: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] char *data = "Hello there!"; ^ ../threads/kernel.cc:209:21: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] char *ack = "Got it!"; ^ In file included from ../threads/synchlist.h:49:0, from ../threads/kernel.cc:14: ../threads/synchlist.cc: In instantiation of ‘SynchList<T>::SynchList() [with T = int]’: ../threads/kernel.cc:158:20: required from here ../threads/synchlist.cc:26:10: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] lock = new Lock("list lock"); ^ ../threads/synchlist.cc:27:15: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] listEmpty = new Condition("list empty cond"); ^ ../threads/synchlist.cc: In instantiation of ‘void SynchList<T>::SelfTest(T) [with T = int]’: ../threads/kernel.cc:159:25: required from here ../threads/synchlist.cc:120:39: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] Thread *helper = new Thread("ping"); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/main.cc ../threads/main.cc:59:8: warning: extra tokens at end of #endif directive [enabled by default] #endif TUT ^ In file included from ../threads/main.cc:41:0: ../lib/copyright.h:23:26: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] static char *copyright = "Copyright (c) 1992-1993 The Regents of the University of California. All rights reserved."; ^ ../threads/main.cc: In function ‘int main(int, char**)’: ../threads/main.cc:182:22: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] char *debugArg = ""; ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/scheduler.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/synch.cc ../threads/synch.cc: In member function ‘void Semaphore::SelfTest()’: ../threads/synch.cc:138:39: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] Thread *helper = new Thread("ping"); ^ ../threads/synch.cc:141:35: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] ping = new Semaphore("ping", 0); ^ ../threads/synch.cc: In constructor ‘Lock::Lock(char*)’: ../threads/synch.cc:161:40: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] semaphore = new Semaphore("lock", 1); // initially, unlocked ^ ../threads/synch.cc: In member function ‘void Condition::Wait(Lock*)’: ../threads/synch.cc:250:43: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] waiter = new Semaphore("condition", 0); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../threads/thread.cc ../threads/thread.cc: In member function ‘void Thread::SelfTest()’: ../threads/thread.cc:430:43: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] Thread *t = new Thread("forked thread"); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../userprog/addrspace.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../userprog/exception.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../userprog/synchconsole.cc ../userprog/synchconsole.cc: In constructor ‘SynchConsoleInput::SynchConsoleInput(char*)’: ../userprog/synchconsole.cc:23:33: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] lock = new Lock("console in"); ^ ../userprog/synchconsole.cc:24:44: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] waitFor = new Semaphore("console in", 0); ^ ../userprog/synchconsole.cc: In constructor ‘SynchConsoleOutput::SynchConsoleOutput(char*)’: ../userprog/synchconsole.cc:79:34: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] lock = new Lock("console out"); ^ ../userprog/synchconsole.cc:80:45: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] waitFor = new Semaphore("console out", 0); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/directory.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/filehdr.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/filesys.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/pbitmap.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/openfile.cc g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../filesys/synchdisk.cc ../filesys/synchdisk.cc: In constructor ‘SynchDisk::SynchDisk()’: ../filesys/synchdisk.cc:30:46: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] semaphore = new Semaphore("synch disk", 0); ^ ../filesys/synchdisk.cc:31:38: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] lock = new Lock("synch disk lock"); ^ g++ -ftemplate-depth-100 -Wno-deprecated -g -Wall -fpermissive -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -DFILESYS_STUB -DRDATA -DSIM_FIX -DTUT -Dx86 -DLINUX -DCHANGED -m32 -c ../network/post.cc ../network/post.cc: In constructor ‘PostOfficeInput::PostOfficeInput(int)’: ../network/post.cc:155:60: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] messageAvailable = new Semaphore("message available", 0); ^ ../network/post.cc:162:43: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] Thread *t = new Thread("postal worker"); ^ ../network/post.cc: In constructor ‘PostOfficeOutput::PostOfficeOutput(double)’: ../network/post.cc:268:50: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] messageSent = new Semaphore("message sent", 0); ^ ../network/post.cc:269:44: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] sendLock = new Lock("message send lock"); ^ In file included from ../threads/synchlist.h:49:0, from ../network/post.h:34, from ../network/post.cc:20: ../threads/synchlist.cc: In instantiation of ‘SynchList<T>::SynchList() [with T = Mail*]’: ../network/post.cc:52:38: required from here ../threads/synchlist.cc:26:10: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] lock = new Lock("list lock"); ^ ../threads/synchlist.cc:27:15: warning: deprecated conversion from string constant tochar*’ [-Wwrite-strings] listEmpty = new Condition("list empty cond"); ^ /lib/cpp -P -I../network -I../filesys -I../userprog -I../threads -I../machine -I../lib -Dx86 -DLINUX ../threads/switch.s > swtch.s as -o switch.o swtch.s swtch.s: Assembler messages: swtch.s:7: 错误: invalid instruction suffix for `push' swtch.s:9: 错误: invalid instruction suffix for `push' swtch.s:10: 错误: operand type mismatch for `call' swtch.s:11: 错误: operand type mismatch for `call' swtch.s:12: 错误: operand type mismatch for `call' swtch.s:14: 错误: invalid instruction suffix for `pop' Makefile:342: recipe for target 'switch.o' failed make: *** [switch.o] Error 1
最新发布
05-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值