C: Sieve of Eratosthenes and next twin prime
Your Concerns
The use of pow(i, 2) is unnecessary; you should simply use i*i.
The goto statement is also unnecessary.  You could wrap the code in while(true) { ... }.
Other Concerns
The cast (int) i is also unnecessary, as i is already an integer.  Perhaps you meant to cast to a double?
Computing sqrt(n) in the for loop termination condition is inefficient; you should compute it once outside the loop.
The primes global should probably be declared static, so it isn’t visible outside the module.  Then the “helper” function sieve_of_eratosthenes should also be static.
Your overflow and resizing of the sieve does not preserve any previous work; perhaps you could use realloc?
No twin prime pair would ever be even, so you could optimize the sieve to skip even numbers.
This statement memset(primes.array, true, n * sizeof(bool)); is questionable.  If a bool is larger than 1 byte, then what are you storing in the array?  For instance, if each sizeof(bool) == 2, then primes.array[0] would be 0x0101, which is not the same as true.