Discussion:
how can i solve issue "stray ‘\210’ in program" and "expected ‘)’ before ‘m’"
shubhu
2014-02-23 11:00:03 UTC
Permalink
i am trying to implement tcp cubic i created the following function :



void TcpCubic::bictcp_recal_ssthresh (void)
{

uint64_t m = (uint64_t) m_beta;
uint32_t o = 1;
if ((fast_convergence) && (m_cWnd < last_max)) {

last_max = m_cWnd*(o−m/2);
m_ssThresh = m_cWnd*(o−m);
}

else
{
last_max = m_cWnd*(o−m);
m_ssThresh = m_cWnd*(o−m);
}

}


when i try to run it i get the error :


/scratch/tcp-cubic.cc:69:1: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:69:1: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:69:1: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc: In member function ‘virtual void
ns3::TcpCubic::bictcp_recal_ssthresh()’:
../scratch/tcp-cubic.cc:69:24: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:70:27: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:75:25: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:76:27: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:65:10: error: unused variable ‘m’
[-Werror=unused-variable]
../scratch/tcp-cubic.cc: In member function ‘virtual void
ns3::TcpCubic::NewAck(const SequenceNumber32&)’:
../scratch/tcp-cubic.cc:130:52: error: cannot convert ‘ns3::int64x64_t’ to
‘uint64_t {aka long unsigned int}’ in assignment
../scratch/tcp-cubic.cc:132:64: error: cannot convert ‘ns3::int64x64_t’ to
‘uint64_t {aka long unsigned int}’ in assignment
cc1plus: all warnings being treated as errors


can anybody help me where i am making mistake and should i do
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to ns-3-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.
Konstantinos
2014-02-23 11:15:57 UTC
Permalink
Hi,

According to
this http://stackoverflow.com/questions/2340930/stray-342-in-c-program it
might be caused by using wrong quotation marks
Do you have any printing (or NS_LOG) and use quotation?
Post by shubhu
void TcpCubic::bictcp_recal_ssthresh (void)
{
uint64_t m = (uint64_t) m_beta;
uint32_t o = 1;
if ((fast_convergence) && (m_cWnd < last_max)) {
last_max = m_cWnd*(o−m/2);
m_ssThresh = m_cWnd*(o−m);
}
else
{
last_max = m_cWnd*(o−m);
m_ssThresh = m_cWnd*(o−m);
}
}
/scratch/tcp-cubic.cc:69:1: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:69:1: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:69:1: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:70:1: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:75:2: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\342’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\210’ in program
../scratch/tcp-cubic.cc:76:2: error: stray ‘\222’ in program
../scratch/tcp-cubic.cc: In member function ‘virtual void
../scratch/tcp-cubic.cc:69:24: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:70:27: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:75:25: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:76:27: error: expected ‘)’ before ‘m’
../scratch/tcp-cubic.cc:65:10: error: unused variable ‘m’
[-Werror=unused-variable]
../scratch/tcp-cubic.cc: In member function ‘virtual void
../scratch/tcp-cubic.cc:130:52: error: cannot convert ‘ns3::int64x64_t’ to
‘uint64_t {aka long unsigned int}’ in assignment
../scratch/tcp-cubic.cc:132:64: error: cannot convert ‘ns3::int64x64_t’ to
‘uint64_t {aka long unsigned int}’ in assignment
cc1plus: all warnings being treated as errors
can anybody help me where i am making mistake and should i do
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to ns-3-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...