gpt4 book ai didi

perl - 如何解决PintOS无法识别的字符\x16

转载 作者:行者123 更新时间:2023-12-04 13:57:03 28 4
gpt4 key购买 nike

我在家用计算机上下载并设置了PintOS及其依赖项,但是当我尝试运行pintos run alarm-multiple时,出现了错误:

Unrecognized character \x16; marked by <-- HERE after if ($<-- HERE near column 7 at ~/code/pintos/src/utils/pintos line 911.



该行上带有 ^V,即同步空闲控制字符。我没有找到有关此问题的任何信息;似乎我是唯一经历过的人。

我已经安装了Perl v5.26.0。

最佳答案

在Perl 5.20中使用literal control characters in variable names was deprecated:

Literal control characters in variable names

This deprecation affects things like $\cT, where \cT is a literal control (such as a NAK or NEGATIVE ACKNOWLEDGE character) in the source code. Surprisingly, it appears that originally this was intended as the canonical way of accessing variables like $^T, with the caret form only being added as an alternative.

The literal control form is being deprecated for two main reasons. It has what are likely unfixable bugs, such as $\cI not working as an alias for $^I, and their usage not being portable to non-ASCII platforms: While $^T will work everywhere, \cT is whitespace in EBCDIC. [perl #119123]



导致此问题的代码已在PintOS中使用 this commit在2016年修复:

committer Ben Pfaff <blp@cs.stanford.edu> 
Tue, 9 Feb 2016 04:47:10 +0000 (20:47 -0800)

Modern versions of Perl prefer a caret in variable names over literal
control characters and issue a warning if the control character is used.
This fixes the warning.

diff --git a/src/utils/pintos b/src/utils/pintos
index 1564216..2ebe642 100755 (executable)
--- a/src/utils/pintos
+++ b/src/utils/pintos
@@ -912,7 +912,7 @@ sub get_load_average {
# Calls setitimer to set a timeout, then execs what was passed to us.
sub exec_setitimer {
if (defined $timeout) {
- if ($\16 ge 5.8.0) {
+ if ($^V ge 5.8.0) {
eval "
use Time::HiRes qw(setitimer ITIMER_VIRTUAL);
setitimer (ITIMER_VIRTUAL, $timeout, 0);


Perl 5.26 made it a fatal error to use literal control characters in variable names

修复它的方法是确保使用的是最新版本的pintOS。命令 git clone git://pintos-os.org/pintos-anon应该可以做到。

关于perl - 如何解决PintOS无法识别的字符\x16,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45656966/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com