what is the meaning of "network interface"?
google network interface
http://en.wikipedia.org/wiki/Network_interface
lol PoppaVic
well, sheesh
hi poppavic
Excuse me, could someone please recommend a good C book for a beginning programmer?
!books
"The C programming Language"
Also known as K&R2
!books
books is http://www.iso-9899.info/wiki/Books
Hi PoppaVic
stupid thing
its not C, its the programmer
damn, that's terribly right
except Acorn C on riscos then it can be C's fault
Wow, who -are- these n00bz?
erug?
gurg?
brb
its not C, its the programmer
Truest thing I've ever heard
it often is C
laul
It's usually the programmer though ;[
uhm ... sorry didnt know that the phrase gets that much attention
http://www.it.iitb.ac.in/~sudhir/Programming/Intresting_C_Problems.html
will the order of the elements of a struct be always the same in memory?
and in continuous memory?
(in linux)
aton`: Have you heard of adjacent memory locations ?
structs are structs - they have a fairly exact spec
thats what i am asking... are the members of a struct in adjacent memory
structs are structs, very correct
brb - might as well recycle
aton`: i think packed helps with that
uhm
tbh i've never had to worry about it
i have a feeling packed was the wrong word to use tho
i want to send structs over the network
aton`: dont do that
and i think about just putting a struct pointer on the beginning of the received data
implement a proper serializer
aton`: are you aton` from ptp ?
_ralph, yes
the questioner's first description of the problem/question will be misleading.
ptp?
We talked about DNA once
Do you remember ?
cehteh, is a serializer really needed
_ralph, roughly
It was an interesting discussion, and we moved to rem sleep etc
aton`: you have to consider packing and endianess
ah yes
aton`: it makes thinks much easier and more portable after you first set it up
;D
you can just use XDR (man xdr)
cehteh, thanks, xdr looks cool
sending structs as is might be the low hanging fruit .. but you'll curse later when you have to fix the website design when you discover the problems
yeah xdr looks sweet
sexps would be another nice serialization format
hmm s-expr?
heh i think this is all overkill for my one struct
google "rivest sexps"
any one use ettercap??
aton`: i dont think so
use htonl() then
sexpr
and dont underestimate serializing to paintext (printf/scanf)
someday, I'll have to diddle with xdr
thats really easy to debug and compared to the I/O overhead its rather not a prerformance problem
Yeah.. Personally, I'm all in favor of text-transfers
cehteh, lol paintext
sexps /are/ plaintext.
as opposed to xdr-type
they allow also binary representations
(of the data)
aton`: most protocols in use over the internet are plaintext
For many very good reasons
cehteh, i see
adding in ssh/ssl and compressions is also doable, too
embedd binary data also ... but your are on a safe side when the protocol metadata is at least readable
easier to debug, easier to allow for variations in ranges, bits, etc
otoh, there is nothing unusual about processes creating a file for use in binary.. Records, structs, etc - for the life of the program, etc
what is the best web hosting graphical debugger (e.g. probably a frontend for gdb)
There really is none
I'm trying out ddd right now with some hopes
DDD is common, so is the stuff kdevelop and Xcode use
Miko-chin!
yeah but learn gdb in the command line first imo
can a ushort_t be cast to a char* without any problem?
wtf is ushort_t? i sincerely doubt it
a ptr is a ptr, so idea what a ushort_t might be
seems to be unsigned short here
So an integer
yup
There is no defined conversion from any integer type to any pointer type
So unlss you're writing device drivers, it really makes no sense
yes thought so...that's why I am wondering
the arpa/tftp.h includes a struct with a ushort_t which can have a block count, but also a string...that is why it is cast to a char* in some cases
just wondering if that might cause problems
seems a bit odd to me
I think you should just forget about that header
hehe
yeah, I start to realize that as well ;-)
I assume I would utilize a union for such cases?
ushort_t crap, char *bar; crap=15; bar=(char *) crap; /* wtf is that? */
Undefined behaviour
I am trying to debug the line dev-dvdcss = DVDcss_open(target)
so I am trying break DVDcss_open in gdb
and it doesn't seem to be catching it
*bzzt*
Was the library compiled with debugging support?
yeah the whole thing should be
``should'' be?
or `is'?
is there a way to verify that it 'is'?
well if you can't get a stack trace in gdb it isn't
ime
meaning symbols not numbers
same if it crashes
$2 = value optimized out
oh turn O off
what does this mean? I can't print this variable?
yeah in a reg typically
I can't, the bug only happens with -O2
if you want to debug, the compile hosting needs to be -ggdb; and no optimizing. Anywhere
oh, and don't strip anything
the bug only happens with -O2.
you can inspect the registers
and compare with asm src
but i don't recommend it
how so I inspect registers
.. do
who on her sanity would inspect manually the asm generated by C code?
buy the GDB book
i do all the time
can I inject a printf statement
??
well haven't for a bit
course you can
means gcc has figured out that it does not, in fact, /need/ that value - likely because it's the same every time
ah ok
I mean at run time
Well, or some other, similar optimiation
why not just put it in src tho?
because I don't know where to put it yet
you need breakpoints for a start
If that's what your function returns.. chances are it isn't actually running the function either, which would explain why a break doesn't work
I'm trying to see where stack corruption is occuring
!b2
The questioner will keep changing the original question until it drives the helpers in the channel insane.
Stack corruption occurs on array overruns, mostly. Try running it under valgrind.
Yeah, I have valgrind output
use assert()
(or my debugging lib
heh gizza url then cehteh
http://www.pipapo.org/pipawiki/NoBug
ty
I created a 'mob' repository on my server host where anyone can push patches anonymously. // hehe
Hmm. Maybe I'll implement an email reader in the exit handler..
hehe
oh dear i have to go out, and i haven;t laughed this much in ages
i think you should lose the bit about the release schedule at the bottom
heh why?
Man, I wish we had a stdint.h for floating.. Dang.
or inttypes, whatever
"Do not trust the code in this repository, anyone could add potentially dangerous code, review every foreign commit before run anything!"
oops
that contradicts the idea of std"INT"
stdNum then
how? what? huh? I just mean that one has no idea of the size of any form of float on any machine, etc.
but when it comes to doubleptr_t people might become scared
people should be scared, and I've never seen that _t
int=float=reg
(as an idea)
ulongdouble_t
I can't believe that for a moment. Since, I've lived w/o fpu and with them.. Lord knows wtf the future holds, let alone any platform.
heh
i hate FPU man
it's horrible
40 cycles for a result?!
iirc, nowadays most cpu build the fpu inside now.. I doubt that would stop someone from building a mobo or daughter-card with a monster or three
hey which time to you live?
it's 0825
FPU's got much faster .. and they calculate in parallel to the cpu
FPU's got much faster .. and they calculate in parallel to the cpu
actually i tihnk i should more often consider floats if applicable
at least integer freakin' works as expected
(knowing their limits)
yep
hehe
sorry that was the PS1 iirc
currently, I'm just using flt_[sml]
?
I can use [u]int?_t and feel safe, but fp just... sucks
leave alone 0.1 or w/e it was
yeah in C it does
cehteh, fp calculations interrupt the normal pipeline-flow. That's still like at least 10-20cycles plus. Often a lot more.
functional langs are pretty good for IEEE fp tho
well, it's worse: you never know wtf the fpu reg-widths are
notadev, in what way?
well i used to use ML a few years ago and i'm getting into haskell now
blech
since they're for mathematicians, the FP tends to be pretty good
ghci is nice, but i can't take it seriously
every function has one parameter? wtf
you need more exposure
god I just hate rrdtool
possibly; to what tho PoppaVic?
perhaps some lisp, or forth
smalltalk and ada maybe
some languages have NO "parameters"
hmm scheme is nice but $ in haskell canes it
http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html
oh wait no.. I get it now... the hate has subsided a bit
heh
lovely
hmm?
give up
hmm?
I'm an unemployed motivational speaker
sounds... exciting
go figure
Liszt - totentanz
Oo
"The Wall" ;-)
'The Wall' as in Pink Floyd's 'The Wall'
yep
"motivational" ;-
"In Latin American cultures, winking is also a romantic or sexual invitation."
sounds depressing
I saw Waters do it live 2 months ago :-)
it be
I'm happy with my recordings
..although I am really PO'd that I lent out my "Chess" cd-set and it's now lost.
pirate a new one
nah.. I should just order a new set.. I've the lps, but no system set up for duplication.
are you on windows?
good lord no
got winex?
why would I do that? come on now.
I have a program here I am trying to debug where it looks like when a particular function is called, the stack gets corrupted. How do I find out where this is happening?
gdb it?
you've been asking for over an hour.
some people never learn
actually I have been stepping through with gdb most of this time
so, what's the problem?
or rtfm, google, test, use a book, etc
yah ^^
hays, compile with the -g option, run gdb, then type ./myprogramname, then type 'r' to run it and when it crashes, type 'bt' to get a backtrace
yes, I have a backtrace. I know where I'm getting a SEG FAULT. but the memory corruption is happening elsewhere
how do you know?
hays, paste the wholel backtrace in rafb.net/paste along with your code
the seg fault is due to the fact that the pointer its trying to write to is corrupt
hays, then why don't you just fix it ?
sigh. I've learned.
Some days, printf-debugging is _still_ more useful.
printf the pointer value every time you use it
similarly, assert
yeah keep an initial copy of the pointer value, and assert against the new one
The bug appears to be more subtle. A function is being called that is corrupting the stack and changing the value of the pointer
Unfortunately the function in question is a horrible mess so I am trying to figure out if there is a way to get information on where something might be trouncing the stack.
LOL
hays, re-write your offending function
yes
http://rafb.net/p/6tsxby48.html
depends in whose hands
rewrite libdvdcss.c? no thanks. There's a reason people haven't touched it in 4 years, methinks.
Jo-W: did you have some point in such a thing?
its just an example
the reason is the same one as why GOOD USE of it does not corrupt pointers
well, it's sily (to me)
yeah well it saves me a couple of if else blocks
Jo-W, how safe is int i = 2 || 1 / 0; ?
anyway, laters people
bye
oh lawd
thats exactly what i want to know
divide by zero?!
don't try that on a wee pentium
or it'll explode
Nande, it won't
can i rely on the fact if a first condition is true, the second never gets executed is the question
Jo-W: yes
Jo-W, yes
lol are you just living on the edge with such bold statements :P
conversely, 0 && foo doesn't evaluate foo
ah mendelssohn
thanks
hey all, I'm trying to debug an apache module, and thought I'd ask some general C questions here
generally, you can ask.. Can't insure answers
the warning I'm trying to solve is "mod_wsgi.c:4544: warning: 'wsgi_execute_remote' used but never defined"
that's not C
fair enough
it's not?
can I ask what it is?
I'd expect it's a gcc warning related to lacking a lib or header
er ...
what is line 4544?
so, line 4544 is:
#if AP_SERVER_MAJORVERSION_NUMBER = 2
static int wsgi_execute_remote(request_rec *r);
#endif
the function isn't called until line 4659
that's just a proto
and then isn't defined until line 6208
hmm
right, ok
so the first instance (line 4544) is a placeholder? a "proto"?
No idea what you are doing wrong
k
it's a function declaration
a proto)type just tells the compiler that some func/type is expected.
as I read it, we can't define the full function at 4544 for whatever reason (other stuff not set up yet)
so we set up the prototype function declaration
and then define the full function later on
ehm no
appearently you use the function without a definition
then it wouldn't be a warning but an error
well, there's a second symptom
no it doesn't mauke
once the file is compiled, the object file doesn't define wsgi_execute_remote
http://rafb.net/p/LbQP1L45.html
compiles fine
i.e., nm(1) lists it as undefined
that's not a static function
ah nvm
didn't see the static part
so why doesn't the later definition "override" the prototype?
is that the right question?
I don't think static functions are supposed to be accessible from the outside
the prototype says "set aside space for a function with this signature"
then we say "here's where we'll use that function"
lastly, we actually define the function
but that's not getting picked up, eh?
are there any pre processor directives around the later definition
which may exlude it
Jo-W: doesn't look like it :-/
why do people hate learning C from the k&r ?
it's the best book
ffs
they love it..
"Normally, function names are global, visible to any part of the entire program. If a function is declared |static|, however, its name is invisible outside of the file in which it is declared." [83]
u"Normally, function names are global, visible to any part of the entire program. If a function is declared |static|, however, its name is invisible outside of the file in which it is declared." [83]/u
humph
K&R is great. nice and small too unlike Deitel or whatnot
hello
lo
ok, so any tips on debugging an "undefined symbol" error?
it's only C chan or also Cpp ?
##C++ is down the hall
thanks
cpp is the preprocessor
if there is an error in wsgi_execute_remote, might that cause it to be ignored?
no
it'd bollix the compile/link
k
they don't they want books that hod their hands
well beginners to C
well some
of the 43 functions defined in this file, only wsgi_execute_remote is undefined
and there's one other instance of a function being declared first, used, then defined
Hey
Anyone know if it's possible for a function to determine all the members of a structure?
how?
a struct is compile-time
rdvade, C has no 'reflection' capabilities like, say, java
you might want a func that is intimate with the struct.
yeah, i've heard that said, I'm making a file parser to get settings from a file and I wanted it to be able to get new settings that get added to the struct without havig to change the function
thanks for the answer
good luck, there are several approaches - you'll read of each
You can run a program through gccxml and include the produced xml with the executable. Presto, reflection.
It's ugly, of course
well, if it's xml - I ain't suprised
Proper reflection would let you /alter/ the structures, too
you don't need xml, just debug information
plus, gccxml seems to think "c++"
gccxml is the best way to get that information
why, there's DWARF embedded in the executable
more compact and sane
I prefer text-based protocols
morning all
oh, fair enough
lo, ericP
erider:
Also, gccxml will work the same on all platforms
but will it produce something binary-accurate ?
ie. give you exact offsets of fields withing structs and so on?
Yes
ah, ok
but where you have gccxml, you also have dwarf
how can i use string as an macro argument in c?
does anyone knows?
I saw an idea of keeping a global array of strings next to it in the program and keeping it up to date, but i dont like that approach, I'll go read up on 'gccxml'
what is so special about strings?
thanks again
#define macro(x) stringfunc("x");
#
hello
are structured passed by value or reference?
C does not have pass-by-reference
there are no references in C
Everything is passed by value
(But the value of an array is a pointer to its first element)
ok
hi folks
hey anybody got the source code of "Numerical Recipies in C++" second edition
we don't do C++ here, or book pirating. go to ##c++ and go buy it.
Did you check the book's website?
ya
its sold
there but i'm a student
and need the source code to learn
NRC had their book online in PDF
Jo-W was right
"are there any pre processor directives around the later definition which may exlude it?"
shaw 'nuff
I just wasn't looking far enough afield
k, next step ...
why is MOD_WSGI_WITH_DAEMONS false?
my calculated udp checksum is always wrong
how do you pack 4 bytes into an int
with
jedi06, use uint32_t type and access the separate bytes with bit operations or via a char * if you don't mind for the endianness thing
jedi06, i'd use left shifting, that way you dont need pointers
inline void pack(unsigned int* v, unsigned char b) { *v = sizeof(unsigned char) * CHAR_BIT; *v |= b; } ?
ewwwwww
http://rafb.net/p/0XZiLI23.html - i always get wrong udp checksums, i have checked it several times
you need the equation that BOTH sides agree on.
PoppaVic damn read just a C book, not fully but i will haha, ask me question lol
idiots... a checksum is 100% dependent upon the code used. Trust me.
If FOO sends you a file with a "checksum" - you need to know exactly how FOO calculated it.. BTDT - have the teeshirt
rfc1071 specifies the algorithm
but it seems i am not able to implement it correctly
I had checksum-issues (long ago), when the Solaris-code did one thing, but didn't publish how - and I was downloading/sending from my x86 linux-machine.. It's not nice.
hey any good sites where is C snippets? not big ones but not 10 liners also, such as 30 or 40.
cprogramming.com and thedailywtf.om checked
alex`: rafb.net
alex`: see the wiki - it's esoteric
What did inline do?
damn gotta re-read this book lol
inlining a function
yes, so it does what?
it takes a function and inlines it into the code
your book will have more details :p
Inlining will not save yer universe
it's more propable that it destroys the universe :p
if you can't write it as a func or a macro, inlining is useless
The _idea_ of inlining is.. You _KNOW_ the source is short and tight and compiling it literally _everywhere_ is a plus.
basically "I am smarter than any optimizing YOU do"
Most folks that inline are "optimizing" for the wrong reasons in the wrong places.
there's no point in optimizing unless it empirically shows itself to be a problem area
Z turned me on to a decent way to "inline" that I recently used for my own "stack" crap.. It's damned fast and faster than normal calls. otoh, the funcs are short as hell.
yeah, start with a func, consider a macro, THEN screw with inline-hell
I thought the idea of inlining was to teach the compiler how to figure out when to do it...
I'm talking about algorithm optimizations
hand-optimizing, etc.
doesn't matter
optimizing is usually the LAST thing to consider
too many folks worry about it (vaguely) too early.
I'm more interested in a decent API and feed/read to calls - optimizing is something folks can do locally (-O2, etc) etc.
Before I worried about "optimal", I'd suffer "reuse", too
Most folks here are already used to porting and the idiosyncracies of their platform.. It's better to write nice, clean code and let _implementations_ be hella-fast/small/both. Stop pretending that every platform has the same OS/lernel/drivers/libs.
lernel/kernel
damned typos
did I say anything?
nah
I sure wish we had better abstraction-layering, but no.
a little abstraction goes a long way.
if you use functions which have clear semantics, then it's relatively easy to compose and decompose them work out where various optimizations belong.
and those optimizations do not then affect the flow or design of the larger program.
yeah, I have to agree
There are PLACES and THINGS that maybe have special optimizing, but that's here or there - not universal.
this is why semantics are so important for programmers to grasp
every program is an ontology.
I'd have to look that up, I thought "teeth" when I saw it ;-)
also semantic vs syntax
it's (to me) akin to lexer vs parser
what are you raving about now crazy man?
someone, somewhere "lexes" a string, (why? we have no idea); THEN, someone, for some reason "parses" that string.. What string? Someone does somthing somewhere for some reason.
me too
so how does it make you feel?
as a rule, I figure "interpret" can mean "do now", "embed", or "delay", etc
that's not how I interpret it
Folks do NOT think that way.. And, I am not sure why
see
showme
so you perceive that string?
*I* percieve chars.. I react. Where are you?
Oo
I percieve words.
I can see dead code Oo
unfortunately, they are not always the ones that were written
I smell dead kittens
well, if I expect a "word" and am "interpreting", I do it. Switching interpreters, stacks, compilers, streams: it's all the same.
You *are* completely nuts.
I have a major issue with inline compiling, but that's me.
how can I make a function's argument optional? like "int handle_string(char *needed, char *notneeded : NULL);" ?
so notneeded defaults to NULL if it's not given
void func(int* arg = NULL);
int handler(int everyone, ...);
see stdarg.h
now, you can write func() and the compiler generates code as if you write func(null)
don't we hate va_list
not really
is there any good tutorial or help for using DLLs and creating those?
it's not pretty, I admit
PoppaVic, ah ok...
msdn, sorsis
thanks
There's no good standard or portable way of doing what you want, sorry.
pmk, va_list works for me
you might need more experince with vsprintf, etc.. Remember: when you are TRUSTING, well - you can get hurt
vsnprintf
yeah, same idea, Nande
tomato
Either yer writing a string to PARSE at runtime, or the 'cmd' tells you what you expect and dying is tolerable.
MSDN should be all you need.
I like msdn
GetProcAddress(), LoadLibrary(), FreeLibrary() - and for the DLL, DllMain().
ew
come now, PoppaVic
no.. bad llama! ;-)
hi
we talked about winking in public before
ty
m$ is atop my hitlist
There are some compiler-specific things in VC++ for convenience, __declspec()'s dllexport and dllimport - but that's just extra.
Goodnight.
Ballmer is quaking in his boots at the thought of a crazy man hating him.
well, you can lust for my pretty butt over there.. Doesn't bug me. ;-)
monkey monkey man
please adverise your booty elsewhere.
ballmer wants to be.. a monkey man
I'm straight as a carbon-arrow.. I've no issues with gays. Latins can be as weird as they like.
can someone check out whats wrong with my tcp/udp checksum function? it drives me crazy: http://rafb.net/p/dWk0pk17.html
aton`: what did you base it on?
the udp and tcp rfcs
I don't see what homosexuality has to do with it.
aton`: I suggest finding a reference implementation
if byte length is odd, you'll checksum garbage.
and if you can some test data
remember that the checksum needs to include the checksum.
oi aton` ...
I'd swear I told you that BOTH ends need exactly the same quation and bits and order and such to deal with CRC
pmk, read my code first, i check for odd length
fax i tried, but none works
none -what- works?
fax, i found only 2 actual implementations
and they did not give me correct numbers as well
aton`: do you use linux?
you just increment the data length if it's odd, without making sure that extra byte is zero in memory. you lose.
pmk, i did.
man read the code before stating "you lose"
could have written it as just checklen += checklen & 1.
can you both stop arguing
Not being "latin", I can't agree.. Any more than "macho" interests me.
pmk line 18 is the check.
aton`: answer my question
fax, yes
aton`: Then why not just use the Working implemeentation from your OS
pmk, checklen gets incremented by one and calloc zeroes it.
its clearly working because you are on IRC right now
including the additional byte
why dont you show aton` your code then
checksums and crc are a mess
http://www.netfor2.com/udpsum.htm
hang on
Nande, thanks
whoops
forgot a few
still cant find any useful c source place zomg
Zhivago, i read that already, but it calculates wrong
this one works for me, aton`
plus it has compiler errors like not defining i
alex`: What do you want
Nande, thanks
fax a source codes to just understand abit more, maybe infecting somet higns or whatever
what
I use it in some software to test our network equipment, aton`
alex`: Use a spell checker
i will test it
alex`: Could you try to describe what you want in actual words?
Anythign related to C source codes
alex`: "Anythign"?
Anything?
alex`: Oh OK I see
why not use a spell checker?
whats that?
what's
a spell checker
alex`: simtel
I have the C source codes.
alex`: Or open your C book.
check the link in topic
Nande, what is unp.h?
UNP
Nande, unix network programming headers?
UNPv1
suck.
i asked nande
aton`, Nande.. Could you please keep your discussion either in private or in public
Not both
its irritating
what?
can't a guy be away.. and have some coffee
mmmmmm steamy
nande it includes lots of other headers...
like udp.h
you know what.. I'll send you the whole thing
yeah that would be better
just don't do any synfloods or rst attacks
well i got the book here
aton`, Nande.. Could you please keep your discussion either in private or in public
but i thought the rfcs would be good
fax, could you /ignore rather than commenting twice?
aton`: No
thanks
well fax, if we keep the files transfers in public the channel will be spammed
I'm sorry, fax...
I'll try be more considerate
blast i need more coffee
I have a file that contains every IPv4 address; should I dcc it to the channel?
oh yes please
that would fill the void
It's bz2 compressed for easy distribution.
every ipv4 address? in order?
aton`: Yes.
hehe
all possible and impossible ones?
just spam the global bgp routing table, prec
that's more than enough
aton`: All 2**32 numbers.
like written in a file by a simple loop?
aton`: One per line, yes.
hehe how big is that file?
can you exclude the martians, prec ?
!locate
Why? That's no fun.
I can't find it now.
that's quite alright, prec
How about 30billionzeros.bz2 ?
shheesh, ok.. So much for Ma & lunch
A beer lunch with your mother?
no, never.. She is 100% dry now.. Don't go there
bad enough I periodically cook with some form of booze.
You ain't suffered until the person you care about is falling-sown stupid and breaking bones and shit - w/o even knowing it.. 24/7
sown/down
geezus... the places we ferreted bout bottles... *sigh* She tried that a few weeks ago with smokes again..
bout/out
heh.. I was the "evil, rotten bastard" again ;-
smoking some ferrets
ferreting smokes
or squirreling.
oh
hehe
squirreling away alcohol
she's got asthma, etc.. I've told her: she is welcome to do the stairs, have a smoke, and then make it up again: fail both directions, and it's over.. This makes me a bastard.
yeah, I won't go there.. Folks that drink to "fall-down-stupid" are just nice.
not nice
cruel to be kind, maybe
well, I've no upside to seeing her die early; and it ain't fair for her to play upon her kids and friends for enabling.
it's..... A Challenge.
You really need to suffer it at least once to believe it.
unreal.
Nande, struct ippseudo is not defined in any file ..
And, to be honest, I'd never wish either/both issues on an enemy..
what's that?
It's akin to suffering folks with alzheimers
what's "it"?
parents that can no longer drink or smoke in and form of "moderation"
ah
and/any
yea
I read it as "any"
my bad
My parents used to smoke before I was born; they both quit.
It's NOT pretty, and you damn near come to tears for them, for you, and for the sibs that blame you and each other
huh what?
yea, I can imagine
I'm on BSD, aton`
I smoke, and I don't plan to quit, I also have no children (that I know of)
my parents don't drink either, except on special occasions
but they're not perfect; we certainly have our issues
when you say "I don't plan to quit" does that mean "I don't like smoking but I'm too lazy to quit" or "I like smoking, so I'm not going to quit"?
Everyone has issues.. That's fine.. If you want to be around, BE AROUND - or, as told Ma' one time: here's the .38, I loaded it - SOLVE IT.
heh
I like my smokes.. I've no kids. I've no one to save.
gotcha
Folks responsible for kids need to be "better" than those w/o.
yea, definitely
I like my cigars
and my beers
People care so much more about their kids than they do about them selves
Which is NOT to say that folks have no right to die.. Everyone has a right to die.
from an evolutionary/scientific standpoint that makes a hell of a lot of sense
but I still find it sad
Nande, i fixed the code but still wrong checksums...
I miss my pipes, but cigs and a drink - usually brew - are a help.
**themselves
but the weirdest thing is... i create the packet, send it, wireshark on my other pc in my lan says : wrong checksum, but wireshark on my friends computer over the internet says: wrong checksum, but different checksum!!!
Everyone, everywhere has a right to die.. The question becomes when. They have kids? grandkids? they are responsible.
the one i calculate, the one my ethereal tells me i should calculate, the one my friend receives and the one my friends ethereal tells him i should calculate
This is one of the reasons I basically live in C
C is perfectly willing to let you blow off a foot or wax yerself.
I'm a little curious what that reason is... (must be good)
C presumes you have the right to be stupid or tired.
I agree. But also keep in mind that some people may want to die today, but if they happen to live on then they'll be glad that they're still here. If I saw someone like that I'd try to prevent them from exercising their right to die if I believed strongly enough that tomorrow they'd be glad
that they're still here.
as opposed to the langs that assume that they are smarter than you and generally know better?
not everyone is happy to live on
eh?
I take the opposite attitude with C. I prefer to always keep on -Wall -pedantic and -std=c89 and then always make sure that I don't get even one warning or error.
no question. I agree. Folks retain the right to Die Well.. But they have no right to make that decline and death ugly for everyone around them.. Nor has any institution the right to make folks die ugly.
yea
certainly, that's like a "checkup"
definitely
There was a scene in "Soylent Green" that I always liked..
I don't see it as a checkup. I see it as programming C. If you do things that don't conform to the standard then you're not "really" programming C.
all those opts are OPTIONS and checkups.
a nice maduro
"maduro"?
they are, yes; but I think they really should be defaults instead of options.
a corona on a normal work day
especially -pedantic and -std=c89
yeah, doctors and children feel the same
instead of -std=gnu89
Soylent Green was awesome
heh; why's that?
do you remember when the old-guy went off to simply die w/o [ain?
pain?
the book was "Make Room, Make Room!"
the movie was pretty decent
yer confusing DESIRE with REQUIRES with OPTION.
yes, he's absolutely literally crazy, be careful
w/o options, gcc is quite friendly
..as it _should_ be
it's not the fault of gcc that folks are perverse, and that the commies can't even agree on a std-CLI
well each system has to have different settings etc anyway
so its only causing a -little- bit of annoyance
well, no
the huge issue is learning about those "little annoyances"
or, even working UNDER them
It takes a mindset that can step back a notch.
Maybe it is annoyances
..and current solutions teeter on a solution.
but people have to realise that if you want software to run on totally different systems you -have- to actually do some system specific code
well, they don't - and folks don't seem to want to teach that
dude, think.. They don't even teach about time and who (compile/interpret) and who does what to whom (where?)
The only HERE issue is" can I? How? and size"; the only THERE issue is exactly the same.
I keep seeing people
every day
I see dead people.
Thinking they shold use "portable libraries" and write portable code
yeah, and they all look the same... and different
they end up writing substandard (lowest common denomenator) shit which they only ever run on *ONE* system
I think there is something about "portable library" that is an issue.
PoppaVic, have you ever actually written any C program?
no
Thought so.
LCD is not substandard or ONE-Universe
Making less sense than Mentifex nowadays, you are.
I'm not sure how to better explain it
a orjbjjkkkkkj
wtf?
regs are not ints, arrays are not strings or structs or unions
"LCD"?
Lowest Common Denominators
THe LCD before calculators ;-)
a
sorry, I thought you meant screens for a sec got confused :p
yeah, this is part of the issue
but yeah, I dunno where they get these ideas into their heads
I agree
prec, monologues are bad...
you speak OF something in terms OF something... and you speak in serveral times.
the meds appear to no longer be effective, pops
Nonsense.
interpreting is pre-compiled (local), compiled is (local) and then there is "run this and leave me alone"
prec, that's the point.
wtf?
Pops, what the fuck does that even mean?
you can believe what you want - everyone seems to do the same
agreed.
you can't even "interpret" unless you have "agreements" between both ends.
wtf?
IF "irc" doesn't typify this, nothing does.
The agreements are blind though
yep, prec has been under heavy drugs effects lately!
As are protocols
but I guess thats largely irrelevant when we have checksumming etc
not really.. They mandate bits/size/order
This channel is completely hopeless.
pmk, just a bit, but we love you.
pmk, leave then?
how do you generate an EOF in bash?
DammitCoetzee, CTRL + D?
DammitCoetzee press control+d
there is no "EOF"
Later, crazy men and hopeless newbies.
thanks, I'm going through K&R =D
there is EOF
EOF is a state, not a char
Bye pmk!
yeah, you dont generate it
your actually signal it
lol pmk left
you generate an EOF signal :o
hmm
You signal generating an EOF signal...
so what do I use the verb generate for?
wow.. You drove off pmk... I am impressed ;-)
meh, he wasn't being very productive
not a huge loss
now when it comes to productivity..
I generate a charachter? I signal an EOF.
I thought he said I wasn't ;-)
C-d
...
NO - a char is not a signal.
a signal is a signal, a char is just a char
it's like having a cigar
You spoke correctly.
In what respect
prec, ok =D
"productivity" is like "readability" or even "preschool" and "college"
it's something we agree to interpret, not something fixed.
what is a good way to do hex-int conversion?
Note that the eof key sequence can be changed with stty. See stty -a
i have a two char hex code I need to convert into integer
It is typically C-d, however.
strtol
anyway, be back later.. Chores to do.
thanks!
Well, assuming you have a string.
If not, use your math skills.
bartels_math_skills--
prec, yea, thanks it worked and I got my output of 7
Can you convert between hex and decimal using pencil and paper (or in your head)?
well, yea
OK, how do you do it?
it was more of a joke than anything
wow
OK. Where are you getting these two char values from?
thats not funny at all..
I'm pretty sure there were like 4 classes in college where they taught that
postgres?
what does this "?" mean
I just didn't know if that's what he meant by where I was getting it
So, you have a string then?
Open the pod bay door, HAL.
:]
yes sir
OK, strtol it is
That's assuming you truly have a string of strlen(s)==2 and not a single byte value.
yep
works great, thanks
i am writing a program that will accept a flag with and arg pair. i don't know how to do regular expression checking to make sure that the arg is not a second flag... what should i search in google to find my answer and learn
Why not use an existing command line parsing library?
i was looking thru prce but i wasn't quit sure what i was reading
If UNIX-y, try getopt or popt. Other platforms have different conventions.
kewl... i will look into them... thanks
Some people, when confronted with a problem, think "I know, I'll use regular expressions". Now they have two problems. - Jamie Zawinski
matchRegex (mkRegex "w.*e") "Could be worse"
`mkRegex'
Oh. It's worse.
hi
Does anyone know what, exactly, is the stack used for DOS / 16 bit ? It seems that there is a 64KB limit for the stack + the global area. I know what the global area is, but I don't understand exactly what goes in the stack. Thanks !
It depends on what memory model you tell your compiler to use
I can't explain any further than that, as I avoid dos like the plague. You should too.
he wants to know what it is used for
I don't have the choice: I have to make an application for a micro-controller which runs on a pseudo-dos with a 16 bit CPU...
Well, you could write your own OS..
That's what most dos programs end up doing anyway, so if you don't have any requirement to keep it around..
Yeah, I could but this is not what my boss pays me for
on DOS it might be
stack holds local variables and call chain of the program
what is the extern keyword function? if i import an header with int number; declaration, i can use number without redeclaring it (with extern int number, right?
Does your controller have an MMU?
If not, could it run muLinux?
anyway I guess the stack + global area thing exists also on non-DOS oses if you use a 16 bit CPU, right ?
Most likely the stack is used for local variables, for passing parameters to functions, for storing return addresses/links for function calling etc.
How much memory do you have physically, anyway?
oh, are you using one a "nasty" model?
it hase 156 KB of RAM, and a flash of 512 KB
256 KB
not 156
It's not a function of the 16-bitness, it's a function of the memory model. For 16-bit *x86* cpus, yes.
768k? wierd!
how can i test a "variable" against a regex in c?
are you talking about the stack and data *segments*?
Read the documentation for your regex library
You cannot. Regular expressions match patterns against text.
and, um, don't you have a copy of the ia-32 manuals?
actually, the RAM is 512 KB, like the flash, but only 256 KB is used, because the other 256 KB are used for something else (storing persistent data)
well Samb
how about the "string" in the variable?
Do you have some text? Fine.
Is it an x86 cpu?
Baughn: it is a 8086 CPU
Which regex library are you using?
none yet, just wanted a nice place to begin looking into it
#regex
ok thanks
That's a nice place to begin looking.
it might sound like a silly question with you using an 8086 and all... but the IA-32 manual does tell you how to use one...
Hav you looked at vxworks
?
prec, thankyou
Your boss may not be paying you to implement an OS, but if you're going to use a pseudo-dos, he /will/ be doing so
I don't have the IA-32 manual, but I'm going to look for it. Is it available on the internet ?
intel.com
also, the Art of Assembly Language (DOS 16-bit) version might be useful
hmm.
any good intro to PPC asm?
version should have gone inside the parens... oh well ;-)
(also ppc asm is way harder than x86:|)
OK then, I'm going to get some clue, and come back if I need more help
Sure, x86 asm was designed to be easy to write by hand
Thanks for your time.
oo
I see
even if you don't want to write it by hand, you'll want to know how to read and write it and you'll want to see what your compiler is doing...
Where can i find a documentation about C ?
I heard they have some on google.com
K&R, if you don't already have it, is the best source.
You heard wrong. All that stuff is.. mediocre at best, but mostly horrible.
Online ^^
Well, I just type man function =\
that's all I use
All fonctions and mostly used modules
libraries
!c99
!reference
reference is http://www.acm.uiuc.edu/webmonkeys/book/c_guide/ - http://www-ccs.ucsd.edu/c/
Aha!
thx
what include do i need for u_strstr?
what is u_strstr?
Would people recommend #pragma once or #ifndef nowadays?
i use #ifndef for portability
totally #ifndef -- it's idiomatic
and portable
ok, thank you
I haven't done anything in C in a long time and I stumbled across a discussion of that on Wikipedia.
"oh, wow man... Good Niborg"
wb
Hello.
"int v[0];"
It produces a compilation error
yes
that's illegal. You can't have an array with "0" elements
except in C99
eon't ask more - see VLA
Only at the end of a struct, then
eon't/don't
although gcc allows it by default
As a rule, never do that
What is "VLA" ?
VLA is a c99 "variable length array"
variable-length array
for local or a struct, NEVER, EVER do it
Thank you.
sure
what would be the result (and cause) of: struct something { int v[0]; int p[10]; };
Is there a way to do regexp on a Makefile variable?
I assume v == p
I want to replace -O2 with -O0
the result would be an angry compiler and a non-compiling program
It does compile
something along the lines of struct int [NOIDEA]; imt p[10]; "
in what?
fax only if you force c99
http://rafb.net/p/GTybBj63.html
I dont force c99
it's just bad
warnings = -Wshadow -Wwrite-strings -Wno-unused-parameter -Wfloat-equal -pedantic -ansi
er
"I assume v == p". is that the effect? and why
i hav more warnings than that
wont paste them all though
-shallow -pedantic -familyguy
se my test program
hey
by default, gcc will use the best of whatever it wants.
how come when i read the files of a directory they arent in alphabetical order?
with opendir and readdir
I used these warnings to compile that test program
http://rafb.net/p/yQ30FG36.txt
because they're just a bunch of inodes, Master_Medic
don't be nuts, I warn you now
Nande, is there a way to have them come out alphabetized?
sort 'm
:/
$ gcc -W -Wall -pedantic -std=c89 -o zero-length-array zero-length-array.c
zero-length-array.c:1: warning: ISO C forbids zero-size array 'v'
how do you know that's not implementation specific ? i.e. you're in an undefined behaviour case. also, if this is true everywhere, I want to know *why*
although all those options are required to make it blow up
just DON'T
not sure what actually happens when it does compile...
it's not like I'm going to use that in a program, I'm just trying to understand what's going on
always thing in terms of at LEAST 1
thing/think
why are you forcing c89 when it has been specified it's a c99 feature?
By checking the C standard
!standard
http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.pdf - C99 + TC1 + TC2 working paper: http://open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf - comprehensive
reference: http://ccs.ucsd.edu/c/
Thank you.
can you believe it.. some guy at Telecity said we only had 1.8Amps available in 1/2 cabinet
in total
it's madness I tell you
struct { foo bar; snarf blot; snarfblot base[1]; } --- this requires some voodoo, but works everywhere
this is sparta
this is marathon
where we fight xerxes
or was that just salamis?
I appologise for my bad choice of words.
np
been a bad day, in RL, here, and these goddamned cooking-shows (which are programming)
I'm very grateful for all the help/replies I have gotten so far.
##C is a pretty decent channel
if i need to use defs.extension elsewhere in my program can i return its value for use by using return(defs.extension)?
wtf is "defs.extension"?
just a turd variable i am using
geezus
sounds like C++, and yer in the wrong channel
ISO 9899 6.7.5.2 Array declarators #1 says "In addition to optional type qualifiers and the keyword static, the [ and ] may delimit
an expression or *. If they delimit an expression (which specifies the size of an array), the
expression shall have an integer type. If the expression is a constant expression, it shall
have a value greater than zero."
can you boil that?
please?
read the last line
ahh
i included it all just so that you'd see it was referring to what is between [ and ]
I'm sorry about the personal question, may I know how many years of experience you have in C programming? You are very knowledgeable, and my curiosity would be satisfied to know how long it took you to reach such a high level. If you would be so kind to answer, I'd be very grateful.
You have already been very kind.
ok so arr[0] is unspecified
so, foo[0] - anywhere is moot, and foo[1] at the eo struct remains usuable, but non-ctor
what it does
so thats basically just incorrect?
I've been at C since the late 70's.
afaict
PoppaVic is over 200 years old
Thank you.
sure
on bad days? Yeah, my hip feels that way
"mummies"
Thank you for all the answers, you have all been two kind to tolerate my questions. Have a lovely and satisfying rest of the day.
"too kind" even
what a polite young woman.
doesn't bother me.. Polite was very nice
I just hope we helped
some days, you just feel you are not getting thru to the knothead.. I can sympathize with teachers in some cases.
Err - how can I disable all warnings in GCC?
There's -wno- for specific warnings
..either the student is not READING it right, or the teacher is not SAYING it right.
fix you code and all warnings will cease
bad idea
PoppaVic - most programmers don't even deal with them
you can shut off warnings; you cn IGNORE warnings.. But you damned well need to see most of them.
well, that's why my respect-meter has a small scale.
most programmers create programs with a lot of bugs ... do you want to do that to ?
They just distribute their source without fixing the damn warnings - I'm compiling this package on a slow PC so turning off warnings would help speed things up
pipe to /dev/null
HAHA - not on linux
there are some warnings that you can certainly ignore - when you know better. Better to hear them whime than ignore them. If you don't want to ignore them, RESOLVE them
You should see my code - fucking. Dude I'm not going to go around resolving all warnings in a 80,000 line SDK or so
or you can also read the manuel
manual
If there was a way to disable warnings? I'd turn it off, I WANT the track-record.. I can read
by "default" gcc doesn't tell you dick that isn't harmful... "hmmmm"
koollman, I did google for it
try writing better code
amen
pizza__, not my code
I did not said 'google' (even if it is probably on the web)
I said 'read the manual'
doesn't matter
man gcc
i know the feeling!
Folks FEED c99, c89, c80, ansi, etc... IF what you feed makes shit unhappy (locally), it _should_ complain... Why is this spastic?
koollman, I'm not on Linux, "man" is unknown command
tough
gcc url
Google knows about 'man gcc'.
I would not argue that long on irc and just compile the code
lacking 'man' and 'info' is not remotely a reason for "I write crap"
multiple variants
That's usually not a problem.
You just read them all. ;-)
not to google, add an arg or three - better yet, install manpages
"screwdriver" - find a "manpage"
there are at least 4 types of "screw" I know of
5, actually
6 is more accurate
you should watch more adult videos
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning%20Options
yeah, it's ugly ;-)
I mean that manual sucks donkey balls
It's uninformative when it comes to a person trying to find out how to turn off all warnings
Diagnostic messages usually cascade. Fixing a few can many times fix a lot of spurious warnings too.
stop pretending the WEB is YOUR manpage\
well ... it's on the page you pasted, actually
I suggest starting with the first warning you encounter and fix it.
amen
jburd - like I said it's not my code
Is the code proprietary?
There's 80,000 lines of code, it takes 10 hours to compile - I'm just hoping to speed it up
did you actually read this part of the manual ?
jburd, yes
Ah, well, dump the thing. It's 80,000 lines of garbage.
you are making it "your code" - no one gives a dead rats-ass if it was predicated.
You can use distcc, ccache, lower optimizations and multiple computers to speed up your compilation.
what MATTERS is - 1) it's there; 2) you misuse it.
PoppaVic, looks like you're running out of things to complain about
does gdb work when you are calling a function initialized through dlopen?
so ... what are you going to do ? read the manual ? or continue to complain ?
not at all, yer welcome to cry in yer beer/coffee forever - just warn me.
sure
BTW
have you an idea of the meaning of 'Inhibit all warning messages.' ?
"-w"
Yes I know
He's just about to shoot his own foot with a canonball.
(poppavic folds the chair and passes it...)
just-another-day
Disable warnings and you get a free bonus of endless debugging hours. You'll need a lot of luck and sleeping pills. :-)
i've set a watchpoint and it doesn't seem to be going deeper than a certain function
jburd - the lib is guarenteed to work by the company
The compiler disagrees.
Who will you trust?
So all I have to do is compile it
they scream; errors scream AND hinder.. Now, ask yerself WHY?
jburd - the warnings are signed char/unsigned char differences when it comes to passing arrays between functions
stop mixing them
and you can't PASS ARRAYS
yes you can
No, you putz, you can't - and every C-programmer realizes this and doesn't argue about it.
No, You can't not in C
ahh, my screen is better ;-)
If you have an "array" like int x[15]; and you call a function like f(x);
What is actually passed is a pointer to the first element of the array
this is *not* the array itself
You should not argue w/ PoppaVic :p
unsigned char suckIt[4]={'U','S','U','K'}; usigned int *suckIt2 = &suckIt; void someFunction(int a_array) { } someFunction(*suckIt2);
no, folks can argue with me - they do NOT want Zhivago or Xgc on their asses
There passed an array
heh yeah
no
or a depressed twkm
But the fact of the matter is what he said was blatantly wrong
well ... no, you passed an int, and the value of this int depends of a lot of things
I know, I know
no I passed an int that's the value of an array
I just laugh when they make things up like this
Hence I'm passing the fucking array
He thinks an ARRAY is a given, and of size. etc
No you did not, I suggest you re-learn about pointers and array
Yeah, clueless
Haha, face it - your reasoning is flawed
It is you who is wrong, and I will discuss this no further with you
firstly, int *suckIt2 = &suckIt; is illegal, &suckIt is of type char (*)[4] and cannot be assigned to an int * without a cast (invoking implementation-defined behaviour).
I get much the same watching cooking-programs that can't use a tool, or ASSEUME about a tool/ingredient.. Makes you wonder wtf
Draconx|Work, even so
lol
fix the errors and it'll be passing an array
heh "fix the errors and it works!"
no, you will be passing a pointer to an int, which isn't even remotely close to an array.
yeah, add "stiches"
What about a struct with an array in it?
I prefer folks NOT bleed all over, or leave their guts on the floor first.. It's a bitch to clean up
Wait how is that illegal
It compiles fine
Disable the warnings and use the library. We're all wrong here. You're right. :-) Have loads of fun.
oh wow.
You really need to start again
jburd, thank you
You're my new best friend
Yer a HOOT
lol
I think thats terribly cruel jburd
I think that delivered the point across.
I think it's reality - nose-smacking 'im
6.5.4 Cast operators ... Constraints: ... Conversions that involve pointers, oher than where permitetd by the constraints of 6.5.16.1, shall be specified by means of an explicit cast.
for the record, 6.5.16.1 does not allow that particular conversion, and violating a constraint invokes undefined behaviour.
C is NOT kind.. Get USED to it
C is just something that abstracts the assemblers. GET USED TO IT
C is not evil.. Just - limited
C has the most bare, naked, fucked ideas of size and space and where and when.. Well, GET USED TO IT
geezus
"A C program is like a fast dance on a newly waxed dance floor by people carrying razors." - Waldi Ravens. That's a nice quote. :-)
hmmm, yeah - I'd buy that
You can kind of pass an array in C.
http://rafb.net/p/PZKO2q91.html
C harshness forces you to acquire a more in-depth knowledge of how things work in computers
ah for fucks sake
You are *not* passing an array
pointer to the first element
sizeof(array_t) seems to be != sizeof(char*)
one of the "features" of C is that it automatically converts things that look like arrays in function parameter lists into pointers... i.e. int foo(int bar[5]) becomes int foo(int *bar) -- this applies with typedefs, as well.
yes, because array_t is not a char *.
this "conversion" does not occur in any other context, and is often a source of confusion.
as far as C returns/parm are concerned: ther is no "array"
one might say that C passes the array by performing an implicit cast to a pointer to the first element
(and passing that)
no
there is no such thing as an "implicit cast". C merely evaluates the array, yielding a pointer, and passes that (the value of the array) to the function.
it passes a pointer to the first element
so it passes the value of the array, like it passes the value of the int, or the value of the char.
e.g., pass by value.
how do you make an array of strings?
now, it is somewhat silly that C does not have array values, but it is at least consistent.
char**
hays didn't get it, yet
C is not "hold my hand". I'ts one notch above "load AX"
impulze, so char** names[10];
no
it sounds like C passes the value of the array, which happens to also be the same value as the pointer to the first element.
char names[10][100];
that NOTCH means an interpreter, a compiler, and a LIB of common FUNCTIONS.
I still think fax is wrong
char* [] x; Is x an array char*?
no, that is not a valid type in C.
char*[] is not valid
wtf is [10][10'
s/type/declaration/
oh, geezus
what is the value of this array: char name[8] = { 'U', 'S', 'U', 'K' };
:P
ack. s/8/4
do NOT confuse "C strings" with other idotic data
strncat(names[0], "john");
Sorry, I meant char* x[];
I believe x is an array of char*. Yes?
Arrays are not pointer.. Think about it
http://rafb.net/p/h3kzmz62.html
x is an array of unspecified length of char * objects. This kind of declaration is illegal in most contexts.
char* x[] = {"str", "str2"};
That compiles and gives me the correct values.
sure.
that is not the same thing as what you previously posted.
Draconx|Work, thanks.
OBCT, how do you access the 2nd char of x[1]?
I think you are missing a const in there somewhere
hays, it's 1263883093
Unless you can adjust yer headspace to ANYTHING is an array[1+] of a type or a typedef or OF something, yer digging a really deep hole.
Master_Medic, x[1][1].
That's if the end parts of the array are 00, 00, 00, 00
OBCT, i see, so you can also declare it as char x[10][100]
I don't think you understand.
1+ dim arrays are BAD.. learn why
the value is the address, name
the value of the whole is 1263883093
Do you guys use the built-in array type or do you "wrap" it around a "safer" struct?
the value is the value of the pointer to the first element of it.
...btw, it ain't just me: THINK about "dimensions"
the address
http://rafb.net/p/jobS6686.html
there is no "array type"
hays - yes I know that - I'm just trying to open up your "third eye blind"
SANiK is pwned
PoppaVic, I meant array. Sorry.
warnings being treated as errors"
lol
there is here[0] and there is "elsewhere"
I just looked at your code
the value of an array is a pointer to its first element, always. There is are no exceptions to this rule. There is no such thing as an array value in C. C passes values to functions. Thus, there is no way to pass an array to a function.
That is how I try to code.
this 12363.. crap is nonsense
that is not a value of anything. You've made up semantics.
yes it is
when folks start [a][b] - they better goddamned well have "wtf" declared.. C is not "kind"
You have failed.
1263883093 = 'U' 'S' 'U' 'K' 0 0 0 0
It's a qword
unsigned long long
wtf is a qword? and what endian is it?
Listen.
?
http://rafb.net/p/LHo95m22.html Without warnings being treated as errors. :-)
show me where the value of an unsigned long long is guaranteed to be 8*sizeof(char)
hays, now my friend you've got me
Think of C as the meanist, nastest math/language teachers you EVER had out of kindergarten
who eventually committed suicide
IF the default settings work, and you pass to the next grade; FINE
PoppaVic, why are you here? Do you still program in C?
math full of exceptions and speial cases
\if the teacher specifies some settings, and you fail - learn WHY
I live in C
there are no "exceptions" in C
You guys should see what we have in our labs at ZercTek
you PASS or, you fail - why?
ogitocay goeray umsay.
that [0] thing is an eample of what I meant by exception
no
That's language
there are no exceptions, but there is goto.
My point is, you guys focus too much on "array is an address to the first entry" and don't think about the data and the different ways it can be expressed
YOu have no point, you just wrong
Once you realise -why- you can start to learn
Yoda-speak is not C
an array isn't a pointer to its first element. The *value* of an array is.
fax, how is passing each individual element of an array considered "NOT" passing an array
acually he is correct that arrays are passed by value in C.
##C will _tolerate_ yodaspeak ;-
all you have to do is read that sentence you just wrote, the answer is -right there-
fax - yet again look what I wrote above
My point is, you guys focus too much on "array is an address to the first entry" and don't think about the data and the different ways it can be expressed
structs are, unions are, primitive types are
Arrays are not.
Free your mind, DATA is the ARRAY
NOW yer cookin' ;-)
Stop being ridiculous please.
sure they are. they are passed by value. The value of an array in C is the same as the value of a pointer to the first element of the array.
I can't believe we are arguing over basics such as arrays